Class CrossbowMeta
java.lang.Object
net.minestom.server.item.metadata.CrossbowMeta
- All Implemented Interfaces:
ItemMeta
public class CrossbowMeta extends java.lang.Object implements ItemMeta
-
Constructor Summary
Constructors Constructor Description CrossbowMeta()
-
Method Summary
Modifier and Type Method Description ItemMeta
copy()
Copies this item meta.ItemStack
getProjectile1()
Gets the first projectile.ItemStack
getProjectile2()
Gets the second projectile.ItemStack
getProjectile3()
Gets the third projectile.boolean
hasNbt()
Gets if this meta object contains any useful data to send to the client.boolean
isCharged()
Gets if the crossbow is currently charged.boolean
isSimilar(ItemMeta itemMeta)
Gets if the two ItemMeta are similar.boolean
isTriple()
Gets if this crossbow is charged with 3 projectiles.void
read(org.jglrxavpok.hephaistos.nbt.NBTCompound compound)
Reads nbt data from a compound.void
setCharged(boolean charged)
Makes the bow charged or uncharged.void
setProjectile(ItemStack projectile)
Sets the projectile of this crossbow.void
setProjectiles(ItemStack projectile1, ItemStack projectile2, ItemStack projectile3)
Sets the triple projectiles of this crossbow.void
write(org.jglrxavpok.hephaistos.nbt.NBTCompound compound)
Writes nbt data to a compound.
-
Constructor Details
-
CrossbowMeta
public CrossbowMeta()
-
-
Method Details
-
setProjectile
Sets the projectile of this crossbow.- Parameters:
projectile
- the projectile of the crossbow
-
setProjectiles
public void setProjectiles(@NotNull ItemStack projectile1, @NotNull ItemStack projectile2, @NotNull ItemStack projectile3)Sets the triple projectiles of this crossbow.- Parameters:
projectile1
- the projectile 1projectile2
- the projectile 2projectile3
- the projectile 3
-
isTriple
public boolean isTriple()Gets if this crossbow is charged with 3 projectiles.- Returns:
- true if this crossbow is charged with 3 projectiles, false otherwise
-
getProjectile1
Gets the first projectile.- Returns:
- the first projectile, null if not present
-
getProjectile2
Gets the second projectile.- Returns:
- the second projectile, null if not present
-
getProjectile3
Gets the third projectile.- Returns:
- the third projectile, null if not present
-
isCharged
public boolean isCharged()Gets if the crossbow is currently charged.- Returns:
- true if the crossbow is charged, false otherwise
-
setCharged
public void setCharged(boolean charged)Makes the bow charged or uncharged.- Parameters:
charged
- true to make the crossbow charged, false otherwise
-
hasNbt
public boolean hasNbt()Description copied from interface:ItemMeta
Gets if this meta object contains any useful data to send to the client. -
isSimilar
Description copied from interface:ItemMeta
Gets if the two ItemMeta are similar.It is used by
ItemStack.isSimilar(ItemStack)
. -
read
public void read(@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound compound)Description copied from interface:ItemMeta
Reads nbt data from a compound.WARNING: it is possible that it contains no useful data, it has to be checked before getting anything.
-
write
public void write(@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound compound)Description copied from interface:ItemMeta
Writes nbt data to a compound. -
copy
Description copied from interface:ItemMeta
Copies this item meta.Used by
ItemStack.copy()
.
-