Package net.minestom.server.inventory
Interface EquipmentHandler
- All Known Implementing Classes:
EntityCreature
,LivingEntity
,Player
,PlayerInventory
,PlayerProjectile
public interface EquipmentHandler
-
Method Summary
Modifier and TypeMethodDescription@NotNull ItemStack
getBoots()
Gets the boots.@NotNull ItemStack
Gets the chestplate.default @NotNull ItemStack
getEquipment
(@NotNull EquipmentSlot slot) Gets the equipment in a specific slot.default @NotNull EntityEquipmentPacket
Gets the packet with all the equipments.@NotNull ItemStack
Gets the helmet.default @NotNull ItemStack
getItemInHand
(Player.Hand hand) Gets theItemStack
in the specific hand.@NotNull ItemStack
Gets theItemStack
in main hand.@NotNull ItemStack
Gets theItemStack
in off hand.@NotNull ItemStack
Gets the leggings.default boolean
hasEquipment
(@NotNull EquipmentSlot slot) void
Changes the boots.void
setChestplate
(@NotNull ItemStack itemStack) Changes the chestplate.default void
setEquipment
(@NotNull EquipmentSlot slot, @NotNull ItemStack itemStack) void
Changes the helmet.default void
setItemInHand
(Player.Hand hand, @NotNull ItemStack stack) Changes theItemStack
in the specific hand.void
setItemInMainHand
(@NotNull ItemStack itemStack) Changes the main handItemStack
.void
setItemInOffHand
(@NotNull ItemStack itemStack) Changes the off handItemStack
.void
setLeggings
(@NotNull ItemStack itemStack) Changes the leggings.default void
syncEquipment
(@NotNull EquipmentSlot slot) Sends a specific equipment to viewers.
-
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
-
setEquipment
default void setEquipment(@NotNull @NotNull EquipmentSlot slot, @NotNull @NotNull ItemStack itemStack) -
hasEquipment
-
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
- Throws:
IllegalStateException
- if 'this' is not anEntity
-