Package net.minestom.server.inventory
Interface EquipmentHandler
- All Known Implementing Classes:
EntityArmorStand
,EntityBat
,EntityBee
,EntityBlaze
,EntityCat
,EntityCaveSpider
,EntityChicken
,EntityCow
,EntityCreature
,EntityCreeper
,EntityDolphin
,EntityEndermite
,EntityFox
,EntityGhast
,EntityGiant
,EntityGuardian
,EntityIronGolem
,EntityMooshroom
,EntityOcelot
,EntityPanda
,EntityPhantom
,EntityPig
,EntityPolarBear
,EntityRabbit
,EntitySilverfish
,EntitySlime
,EntitySnowman
,EntitySpider
,EntityWitch
,EntityZombie
,EntityZombifiedPiglin
,FakePlayer
,LivingEntity
,Player
,PlayerInventory
public interface EquipmentHandler
-
Method Summary
Modifier and Type Method Description ItemStack
getBoots()
Gets the boots.ItemStack
getChestplate()
Gets the chestplate.default ItemStack
getEquipment(EntityEquipmentPacket.Slot slot)
Gets the equipment in a specific slot.default EntityEquipmentPacket
getEquipmentsPacket()
Gets the packet with all the equipments.ItemStack
getHelmet()
Gets the helmet.default ItemStack
getItemInHand(Player.Hand hand)
Gets theItemStack
in the specific hand.ItemStack
getItemInMainHand()
Gets theItemStack
in main hand.ItemStack
getItemInOffHand()
Gets theItemStack
in off hand.ItemStack
getLeggings()
Gets the leggings.void
setBoots(ItemStack itemStack)
Changes the boots.void
setChestplate(ItemStack itemStack)
Changes the chestplate.void
setHelmet(ItemStack itemStack)
Changes the helmet.default void
setItemInHand(Player.Hand hand, ItemStack stack)
Changes theItemStack
in the specific hand.void
setItemInMainHand(ItemStack itemStack)
Changes the main handItemStack
.void
setItemInOffHand(ItemStack itemStack)
Changes the off handItemStack
.void
setLeggings(ItemStack itemStack)
Changes the leggings.default void
syncEquipment(EntityEquipmentPacket.Slot slot)
Sends a specific equipment to viewers.default void
syncEquipments()
Sends all the equipments to all viewers.default void
syncEquipments(PlayerConnection connection)
Sends all the equipments to aPlayerConnection
.
-
Method Details
-
getItemInMainHand
Gets theItemStack
in main hand.- Returns:
- the
ItemStack
in main hand
-
setItemInMainHand
Changes the main handItemStack
.- Parameters:
itemStack
- the main handItemStack
-
getItemInOffHand
Gets theItemStack
in off hand.- Returns:
- the item in off hand
-
setItemInOffHand
Changes the off handItemStack
.- Parameters:
itemStack
- the off handItemStack
-
getItemInHand
Gets theItemStack
in the specific hand. -
setItemInHand
Changes theItemStack
in the specific hand.- Parameters:
hand
- the hand to set the item tostack
- theItemStack
to set
-
getHelmet
Gets the helmet.- Returns:
- the helmet
-
setHelmet
Changes the helmet.- Parameters:
itemStack
- the helmet
-
getChestplate
Gets the chestplate.- Returns:
- the chestplate
-
setChestplate
Changes the chestplate.- Parameters:
itemStack
- the chestplate
-
getLeggings
Gets the leggings.- Returns:
- the leggings
-
setLeggings
Changes the leggings.- Parameters:
itemStack
- the leggings
-
getBoots
Gets the boots.- Returns:
- the boots
-
setBoots
Changes the boots.- Parameters:
itemStack
- the boots
-
getEquipment
Gets the equipment in a specific slot.- Parameters:
slot
- the equipment to get the item from- Returns:
- the equipment
ItemStack
-
syncEquipments
Sends all the equipments to aPlayerConnection
.- Parameters:
connection
- the connection to send the equipments to
-
syncEquipments
default void syncEquipments()Sends all the equipments to all viewers. -
syncEquipment
Sends a specific equipment to viewers.- Parameters:
slot
- the slot of the equipment
-
getEquipmentsPacket
Gets the packet with all the equipments.- Returns:
- the packet with the equipments, null if all equipments are air
- Throws:
java.lang.IllegalStateException
- if 'this' is not anEntity
-