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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setProjectile

      public void setProjectile​(@NotNull ItemStack projectile)
      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 1
      projectile2 - the projectile 2
      projectile3 - 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

      public ItemStack getProjectile1()
      Gets the first projectile.
      Returns:
      the first projectile, null if not present
    • getProjectile2

      public ItemStack getProjectile2()
      Gets the second projectile.
      Returns:
      the second projectile, null if not present
    • getProjectile3

      public ItemStack 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.
      Specified by:
      hasNbt in interface ItemMeta
      Returns:
      true if this item has nbt data, false otherwise
    • isSimilar

      public boolean isSimilar​(@NotNull ItemMeta itemMeta)
      Description copied from interface: ItemMeta
      Gets if the two ItemMeta are similar.

      It is used by ItemStack.isSimilar(ItemStack).

      Specified by:
      isSimilar in interface ItemMeta
      Parameters:
      itemMeta - the second item meta to check
      Returns:
      true if the two meta are similar, false otherwise
    • 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.

      Specified by:
      read in interface ItemMeta
      Parameters:
      compound - the compound containing the data
    • write

      public void write​(@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound compound)
      Description copied from interface: ItemMeta
      Writes nbt data to a compound.
      Specified by:
      write in interface ItemMeta
      Parameters:
      compound - the compound receiving the item meta data
    • copy

      @NotNull public ItemMeta copy()
      Description copied from interface: ItemMeta
      Copies this item meta.

      Used by ItemStack.copy().

      Specified by:
      copy in interface ItemMeta
      Returns:
      the cloned item meta