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 ItemStackgetBoots()Gets the boots.@NotNull ItemStackGets the chestplate.default @NotNull ItemStackgetEquipment(@NotNull EquipmentSlot slot) Gets the equipment in a specific slot.default @NotNull EntityEquipmentPacketGets the packet with all the equipments.@NotNull ItemStackGets the helmet.default @NotNull ItemStackgetItemInHand(Player.Hand hand) Gets theItemStackin the specific hand.@NotNull ItemStackGets theItemStackin main hand.@NotNull ItemStackGets theItemStackin off hand.@NotNull ItemStackGets the leggings.default booleanhasEquipment(@NotNull EquipmentSlot slot) voidChanges the boots.voidsetChestplate(@NotNull ItemStack itemStack) Changes the chestplate.default voidsetEquipment(@NotNull EquipmentSlot slot, @NotNull ItemStack itemStack) voidChanges the helmet.default voidsetItemInHand(Player.Hand hand, @NotNull ItemStack stack) Changes theItemStackin the specific hand.voidsetItemInMainHand(@NotNull ItemStack itemStack) Changes the main handItemStack.voidsetItemInOffHand(@NotNull ItemStack itemStack) Changes the off handItemStack.voidsetLeggings(@NotNull ItemStack itemStack) Changes the leggings.default voidsyncEquipment(@NotNull EquipmentSlot slot) Sends a specific equipment to viewers.
-
Method Details
-
getItemInMainHand
Gets theItemStackin main hand.- Returns:
- the
ItemStackin main hand
-
setItemInMainHand
Changes the main handItemStack.- Parameters:
itemStack- the main handItemStack
-
getItemInOffHand
Gets theItemStackin off hand.- Returns:
- the item in off hand
-
setItemInOffHand
Changes the off handItemStack.- Parameters:
itemStack- the off handItemStack
-
getItemInHand
Gets theItemStackin the specific hand. -
setItemInHand
Changes theItemStackin the specific hand.- Parameters:
hand- the hand to set the item tostack- theItemStackto 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
-