Class ItemProjectile

java.lang.Object
net.glowstone.block.itemtype.ItemType
net.glowstone.block.itemtype.ItemProjectile
Direct Known Subclasses:
ItemEgg, ItemExperienceBottle, ItemSnowball

public abstract class ItemProjectile extends ItemType
An item that can be used to throw a projectile (egg, snowball, etc.)
  • Field Details

    • entityType

      protected final org.bukkit.entity.EntityType entityType
  • Constructor Details

    • ItemProjectile

      public ItemProjectile(org.bukkit.entity.EntityType entityType)
  • Method Details

    • getContext

      public ItemType.Context getContext()
      Description copied from class: ItemType
      Get the context this item can be used in.
      Overrides:
      getContext in class ItemType
      Returns:
      context of the item, default is {ItemType.Context.BLOCK}
    • rightClickAir

      public void rightClickAir(GlowPlayer player, org.bukkit.inventory.ItemStack holding)
      Description copied from class: ItemType
      Called when a player right-clicks in midair while holding this item. Also called by default if rightClickBlock is not overridden.
      Overrides:
      rightClickAir in class ItemType
      Parameters:
      player - The player
      holding - The ItemStack the player was holding
    • rightClickBlock

      public void rightClickBlock(GlowPlayer player, GlowBlock target, org.bukkit.block.BlockFace face, org.bukkit.inventory.ItemStack holding, org.bukkit.util.Vector clickedLoc, org.bukkit.inventory.EquipmentSlot hand)
      Description copied from class: ItemType
      Called when a player right-clicks on a block while holding this item.
      Overrides:
      rightClickBlock in class ItemType
      Parameters:
      player - The player
      target - The block the player right-clicked
      face - The face on which the click occurred
      holding - The ItemStack the player was holding
      clickedLoc - The coordinates at which the click occurred
      hand - The hand slot of this item
    • use

      public abstract org.bukkit.entity.Projectile use(GlowPlayer player, org.bukkit.inventory.ItemStack holding)
      Throws this projectile.
      Parameters:
      player - the player throwing the projectile
      holding - the projectile as an item
      Returns:
      the projectile as an entity