Class ItemEdibleBehavior

java.lang.Object
org.cloudburstmc.server.item.behavior.CloudItemBehavior
org.cloudburstmc.server.item.behavior.ItemEdibleBehavior
All Implemented Interfaces:
org.cloudburstmc.api.item.behavior.ItemBehavior
Direct Known Subclasses:
ItemAppleGoldBehavior, ItemAppleGoldEnchantedBehavior, ItemChorusFruitBehavior

public abstract class ItemEdibleBehavior extends CloudItemBehavior
author: MagicDroidX Nukkit Project
  • Constructor Details

    • ItemEdibleBehavior

      public ItemEdibleBehavior()
  • Method Details

    • onClickAir

      public boolean onClickAir(org.cloudburstmc.api.item.ItemStack item, com.nukkitx.math.vector.Vector3f directionVector, org.cloudburstmc.api.player.Player p)
      Description copied from class: CloudItemBehavior
      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.
      Specified by:
      onClickAir in interface org.cloudburstmc.api.item.behavior.ItemBehavior
      Overrides:
      onClickAir in class CloudItemBehavior
      directionVector - direction
      p - player
      Returns:
      item changed
    • onUse

      public org.cloudburstmc.api.item.ItemStack onUse(org.cloudburstmc.api.item.ItemStack item, int ticksUsed, org.cloudburstmc.api.player.Player player)
      Specified by:
      onUse in interface org.cloudburstmc.api.item.behavior.ItemBehavior
      Overrides:
      onUse in class CloudItemBehavior