Class ItemBucketBehavior

java.lang.Object
org.cloudburstmc.server.item.behavior.CloudItemBehavior
org.cloudburstmc.server.item.behavior.ItemBucketBehavior
All Implemented Interfaces:
org.cloudburstmc.api.item.behavior.ItemBehavior

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

    • ItemBucketBehavior

      public ItemBucketBehavior()
  • Method Details

    • getName

      protected static String getName(int meta)
    • getBlockIdFromDamage

      public static org.cloudburstmc.api.block.BlockType getBlockIdFromDamage(org.cloudburstmc.api.item.data.Bucket data)
    • getDamageFromIdentifier

      public org.cloudburstmc.api.item.data.Bucket getDamageFromIdentifier(org.cloudburstmc.api.block.BlockType id)
    • getMaxStackSize

      public int getMaxStackSize(org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      getMaxStackSize in interface org.cloudburstmc.api.item.behavior.ItemBehavior
      Overrides:
      getMaxStackSize in class CloudItemBehavior
    • canBeActivated

      public boolean canBeActivated()
      Specified by:
      canBeActivated in interface org.cloudburstmc.api.item.behavior.ItemBehavior
      Overrides:
      canBeActivated in class CloudItemBehavior
    • onActivate

      public org.cloudburstmc.api.item.ItemStack onActivate(org.cloudburstmc.api.item.ItemStack itemStack, org.cloudburstmc.api.player.Player player, org.cloudburstmc.api.block.Block block, org.cloudburstmc.api.block.Block target, org.cloudburstmc.api.util.Direction face, com.nukkitx.math.vector.Vector3f clickPos, org.cloudburstmc.api.level.Level level)
      Specified by:
      onActivate in interface org.cloudburstmc.api.item.behavior.ItemBehavior
      Overrides:
      onActivate in class CloudItemBehavior
    • onClickAir

      public boolean onClickAir(org.cloudburstmc.api.item.ItemStack item, com.nukkitx.math.vector.Vector3f directionVector, org.cloudburstmc.api.player.Player player)
      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
      player - 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
    • getFuelTime

      public short getFuelTime(org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      getFuelTime in interface org.cloudburstmc.api.item.behavior.ItemBehavior
      Overrides:
      getFuelTime in class CloudItemBehavior