Class CloudItemBehavior

java.lang.Object
org.cloudburstmc.server.item.behavior.CloudItemBehavior
All Implemented Interfaces:
org.cloudburstmc.api.item.behavior.ItemBehavior
Direct Known Subclasses:
ItemArmorBehavior, ItemBoatBehavior, ItemBucketBehavior, ItemEdibleBehavior, ItemEndCrystalBehavior, ItemFireChargeBehavior, ItemFireworkBehavior, ItemGlassBottleBehavior, ItemMapBehavior, ItemMinecartBehavior, ItemPaintingBehavior, ItemPotionBehavior, ItemProjectileBehavior, ItemSpawnEggBehavior, ItemToolBehavior, NoopItemBehavior

public abstract class CloudItemBehavior extends Object implements org.cloudburstmc.api.item.behavior.ItemBehavior
author: MagicDroidX Nukkit Project
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    boolean
    canBePlaced​(org.cloudburstmc.api.item.ItemStack item)
     
    boolean
    canDestroy​(org.cloudburstmc.api.item.ItemStack item, org.cloudburstmc.api.util.Identifier identifier)
     
    boolean
    canPlaceOn​(org.cloudburstmc.api.item.ItemStack item, org.cloudburstmc.api.util.Identifier identifier)
     
    int
    getArmorPoints​(org.cloudburstmc.api.item.ItemStack item)
     
    int
    getAttackDamage​(org.cloudburstmc.api.item.ItemStack item)
     
    org.cloudburstmc.api.block.BlockState
    getBlock​(org.cloudburstmc.api.item.ItemStack item)
     
    int
    getEnchantAbility​(org.cloudburstmc.api.item.ItemStack item)
     
    short
    getFuelTime​(org.cloudburstmc.api.item.ItemStack item)
     
    int
     
    int
    getMaxStackSize​(org.cloudburstmc.api.item.ItemStack item)
     
    org.cloudburstmc.api.item.TierType
    getTier​(org.cloudburstmc.api.item.ItemStack item)
     
    org.cloudburstmc.api.item.ToolType
    getToolType​(org.cloudburstmc.api.item.ItemStack item)
     
    int
    getToughness​(org.cloudburstmc.api.item.ItemStack item)
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
    isTool​(org.cloudburstmc.api.item.ItemStack item)
     
    boolean
    isUnbreakable​(org.cloudburstmc.api.item.ItemStack item)
     
    org.cloudburstmc.api.item.ItemStack
    onActivate​(org.cloudburstmc.api.item.ItemStack itemStack, org.cloudburstmc.api.player.Player player, org.cloudburstmc.api.block.Block blockState, org.cloudburstmc.api.block.Block blockState1, org.cloudburstmc.api.util.Direction direction, com.nukkitx.math.vector.Vector3f vector3f, org.cloudburstmc.api.level.Level level)
     
    boolean
    onClickAir​(org.cloudburstmc.api.item.ItemStack item, com.nukkitx.math.vector.Vector3f directionVector, org.cloudburstmc.api.player.Player player)
    Called when a player uses the item on air, for example throwing a projectile.
    org.cloudburstmc.api.item.ItemStack
    onRelease​(org.cloudburstmc.api.item.ItemStack item, int ticksUsed, org.cloudburstmc.api.player.Player player)
     
    org.cloudburstmc.api.item.ItemStack
    onUse​(org.cloudburstmc.api.item.ItemStack item, int ticksUsed, org.cloudburstmc.api.player.Player player)
     
    org.cloudburstmc.api.item.ItemStack
    useOn​(org.cloudburstmc.api.item.ItemStack item, org.cloudburstmc.api.block.BlockState block)
     
    org.cloudburstmc.api.item.ItemStack
    useOn​(org.cloudburstmc.api.item.ItemStack item, org.cloudburstmc.api.entity.Entity entity)
     

    Methods inherited from class java.lang.Object

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

    • CloudItemBehavior

      public CloudItemBehavior()
  • Method Details

    • canBeActivated

      public boolean canBeActivated()
      Specified by:
      canBeActivated in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • canPlaceOn

      public boolean canPlaceOn(org.cloudburstmc.api.item.ItemStack item, org.cloudburstmc.api.util.Identifier identifier)
      Specified by:
      canPlaceOn in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • canDestroy

      public boolean canDestroy(org.cloudburstmc.api.item.ItemStack item, org.cloudburstmc.api.util.Identifier identifier)
      Specified by:
      canDestroy in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • canBePlaced

      public final boolean canBePlaced(org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      canBePlaced in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • getBlock

      public org.cloudburstmc.api.block.BlockState getBlock(org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      getBlock in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • getMaxStackSize

      public int getMaxStackSize(org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      getMaxStackSize in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • getFuelTime

      public short getFuelTime(org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      getFuelTime in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • useOn

      public org.cloudburstmc.api.item.ItemStack useOn(org.cloudburstmc.api.item.ItemStack item, org.cloudburstmc.api.entity.Entity entity)
      Specified by:
      useOn in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • useOn

      public org.cloudburstmc.api.item.ItemStack useOn(org.cloudburstmc.api.item.ItemStack item, org.cloudburstmc.api.block.BlockState block)
      Specified by:
      useOn in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • isTool

      public boolean isTool(org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      isTool in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • getMaxDurability

      public int getMaxDurability()
      Specified by:
      getMaxDurability in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • getTier

      public org.cloudburstmc.api.item.TierType getTier(org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      getTier in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • getToolType

      public org.cloudburstmc.api.item.ToolType getToolType(org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      getToolType in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • isPickaxe

      public boolean isPickaxe()
      Specified by:
      isPickaxe in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • isAxe

      public boolean isAxe()
      Specified by:
      isAxe in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • isSword

      public boolean isSword()
      Specified by:
      isSword in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • isShovel

      public boolean isShovel()
      Specified by:
      isShovel in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • isHoe

      public boolean isHoe()
      Specified by:
      isHoe in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • isShears

      public boolean isShears()
      Specified by:
      isShears in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • isArmor

      public boolean isArmor()
      Specified by:
      isArmor in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • isHelmet

      public boolean isHelmet()
      Specified by:
      isHelmet in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • isChestplate

      public boolean isChestplate()
      Specified by:
      isChestplate in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • isLeggings

      public boolean isLeggings()
      Specified by:
      isLeggings in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • isBoots

      public boolean isBoots()
      Specified by:
      isBoots in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • getEnchantAbility

      public int getEnchantAbility(org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      getEnchantAbility in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • getAttackDamage

      public int getAttackDamage(org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      getAttackDamage in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • getArmorPoints

      public int getArmorPoints(org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      getArmorPoints in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • getToughness

      public int getToughness(org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      getToughness in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • isUnbreakable

      public boolean isUnbreakable(org.cloudburstmc.api.item.ItemStack item)
      Specified by:
      isUnbreakable in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • 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
    • onRelease

      public org.cloudburstmc.api.item.ItemStack onRelease(org.cloudburstmc.api.item.ItemStack item, int ticksUsed, org.cloudburstmc.api.player.Player player)
      Specified by:
      onRelease in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • 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 blockState, org.cloudburstmc.api.block.Block blockState1, org.cloudburstmc.api.util.Direction direction, com.nukkitx.math.vector.Vector3f vector3f, org.cloudburstmc.api.level.Level level)
      Specified by:
      onActivate in interface org.cloudburstmc.api.item.behavior.ItemBehavior
    • onClickAir

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