Package net.minestom.server.inventory
Interface EquipmentHandler
- All Known Implementing Classes:
EntityCreature
,LivingEntity
,Player
public interface EquipmentHandler
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull ItemStack
Gets the body equipment.default @NotNull ItemStack
getBoots()
Gets the boots.default @NotNull ItemStack
Gets the chestplate.@NotNull ItemStack
getEquipment
(@NotNull EquipmentSlot slot) Gets the equipment in a specific slot.default @NotNull EntityEquipmentPacket
Gets the packet with all the equipments.default @NotNull ItemStack
Gets the helmet.default @NotNull ItemStack
getItemInHand
(@NotNull PlayerHand hand) Gets theItemStack
in the specific hand.default @NotNull ItemStack
Gets theItemStack
in main hand.default @NotNull ItemStack
Gets theItemStack
in off hand.default @NotNull ItemStack
Gets the leggings.default boolean
hasEquipment
(@NotNull EquipmentSlot slot) default void
setBodyEquipment
(@NotNull ItemStack itemStack) Changes the body equipment.default void
Changes the boots.default void
setChestplate
(@NotNull ItemStack itemStack) Changes the chestplate.void
setEquipment
(@NotNull EquipmentSlot slot, @NotNull ItemStack itemStack) default void
Changes the helmet.default void
setItemInHand
(@NotNull PlayerHand hand, @NotNull ItemStack stack) Changes theItemStack
in the specific hand.default void
setItemInMainHand
(@NotNull ItemStack itemStack) Changes the main handItemStack
.default void
setItemInOffHand
(@NotNull ItemStack itemStack) Changes the off handItemStack
.default void
setLeggings
(@NotNull ItemStack itemStack) Changes the leggings.default void
syncEquipment
(@NotNull EquipmentSlot slot) Sends a specific equipment to viewers.default void
syncEquipment
(@NotNull EquipmentSlot slot, @NotNull ItemStack stack)
-
Method Details
-
getEquipment
Gets the equipment in a specific slot.- Parameters:
slot
- the equipment to get the item from- Returns:
- the equipment
ItemStack
-
setEquipment
-
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
-
getBodyEquipment
Gets the body equipment. Used by horses, wolves, and llama's.- Returns:
- the body equipment
-
setBodyEquipment
Changes the body equipment. Used by horses, wolves, and llama's.- Parameters:
itemStack
- the body equipment
-
hasEquipment
-
syncEquipment
Sends a specific equipment to viewers.- Parameters:
slot
- the slot of the equipment
-
syncEquipment
-
getEquipmentsPacket
Gets the packet with all the equipments.- Returns:
- the packet with the equipments
- Throws:
IllegalStateException
- if 'this' is not anEntity
-