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
author: MagicDroidX
Nukkit Project
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic org.cloudburstmc.api.block.BlockTypegetBlockIdFromDamage(org.cloudburstmc.api.item.data.Bucket data)org.cloudburstmc.api.item.data.BucketgetDamageFromIdentifier(org.cloudburstmc.api.block.BlockType id)shortgetFuelTime(org.cloudburstmc.api.item.ItemStack item)intgetMaxStackSize(org.cloudburstmc.api.item.ItemStack item)protected static StringgetName(int meta)org.cloudburstmc.api.item.ItemStackonActivate(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)booleanonClickAir(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.ItemStackonUse(org.cloudburstmc.api.item.ItemStack item, int ticksUsed, org.cloudburstmc.api.player.Player player)Methods inherited from class org.cloudburstmc.server.item.behavior.CloudItemBehavior
canBePlaced, canDestroy, canPlaceOn, getArmorPoints, getAttackDamage, getBlock, getEnchantAbility, getMaxDurability, getTier, getToolType, getToughness, isArmor, isAxe, isBoots, isChestplate, isHelmet, isHoe, isLeggings, isPickaxe, isShears, isShovel, isSword, isTool, isUnbreakable, onRelease, useOn, useOn
-
Constructor Details
-
ItemBucketBehavior
public ItemBucketBehavior()
-
-
Method Details
-
getName
-
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:
getMaxStackSizein interfaceorg.cloudburstmc.api.item.behavior.ItemBehavior- Overrides:
getMaxStackSizein classCloudItemBehavior
-
canBeActivated
public boolean canBeActivated()- Specified by:
canBeActivatedin interfaceorg.cloudburstmc.api.item.behavior.ItemBehavior- Overrides:
canBeActivatedin classCloudItemBehavior
-
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:
onActivatein interfaceorg.cloudburstmc.api.item.behavior.ItemBehavior- Overrides:
onActivatein classCloudItemBehavior
-
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:CloudItemBehaviorCalled 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:
onClickAirin interfaceorg.cloudburstmc.api.item.behavior.ItemBehavior- Overrides:
onClickAirin classCloudItemBehaviordirectionVector- directionplayer- 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:
onUsein interfaceorg.cloudburstmc.api.item.behavior.ItemBehavior- Overrides:
onUsein classCloudItemBehavior
-
getFuelTime
public short getFuelTime(org.cloudburstmc.api.item.ItemStack item)- Specified by:
getFuelTimein interfaceorg.cloudburstmc.api.item.behavior.ItemBehavior- Overrides:
getFuelTimein classCloudItemBehavior
-