Class ProjectileItem

java.lang.Object
cn.nukkit.item.Item
cn.nukkit.item.ProjectileItem
All Implemented Interfaces:
BlockID, ItemID, Cloneable
Direct Known Subclasses:
ItemEgg, ItemEnderPearl, ItemExpBottle, ItemPotionLingering, ItemPotionSplash, ItemSnowball

public abstract class ProjectileItem extends Item
Author:
CreeperFace
  • Constructor Details

    • ProjectileItem

      public ProjectileItem(int id, Integer meta, int count, String name)
  • Method Details

    • getProjectileEntityType

      public abstract String getProjectileEntityType()
    • getThrowForce

      public abstract float getThrowForce()
    • onClickAir

      public boolean onClickAir(Player player, Vector3 directionVector)
      Description copied from class: Item
      玩家在空气中投掷如三叉戟一样 返回物品是否改变,例如数量变化或耐久度

      Called when a player uses the item on air, for example throwing a projectile. Returns whether the item was changed, for example count decrease or durability change.

      Overrides:
      onClickAir in class Item
      Parameters:
      player - player
      directionVector - direction
      Returns:
      item changed
    • addThrowSound

      @PowerNukkitOnly protected void addThrowSound(Player player)
    • correctProjectile

      @PowerNukkitOnly protected Entity correctProjectile(Player player, Entity projectile)
    • correctNBT

      protected void correctNBT(CompoundTag nbt)