Package net.minestom.server.inventory
Interface EquipmentHandler
- All Known Implementing Classes:
EntityCreature,LivingEntity,Player,PlayerInventory
public interface EquipmentHandler
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull ItemStackgetBoots()Gets the boots.default @NotNull ItemStackGets the chestplate.@NotNull ItemStackgetEquipment(@NotNull EquipmentSlot slot) Gets the equipment in a specific slot.default @NotNull EntityEquipmentPacketGets the packet with all the equipments.default @NotNull ItemStackGets the helmet.default @NotNull ItemStackgetItemInHand(Player.Hand hand) Gets theItemStackin the specific hand.default @NotNull ItemStackGets theItemStackin main hand.default @NotNull ItemStackGets theItemStackin off hand.default @NotNull ItemStackGets the leggings.default booleanhasEquipment(@NotNull EquipmentSlot slot) default voidChanges the boots.default voidsetChestplate(@NotNull ItemStack itemStack) Changes the chestplate.voidsetEquipment(@NotNull EquipmentSlot slot, @NotNull ItemStack itemStack) default voidChanges the helmet.default voidsetItemInHand(Player.Hand hand, @NotNull ItemStack stack) Changes theItemStackin the specific hand.default voidsetItemInMainHand(@NotNull ItemStack itemStack) Changes the main handItemStack.default voidsetItemInOffHand(@NotNull ItemStack itemStack) Changes the off handItemStack.default voidsetLeggings(@NotNull ItemStack itemStack) Changes the leggings.default voidsyncEquipment(@NotNull EquipmentSlot slot) Sends a specific equipment to viewers.
-
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 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
-
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
-