Package net.minecraft.item
Class BucketItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.BucketItem
- All Implemented Interfaces:
class_5633,ItemConvertible
- Direct Known Subclasses:
FishBucketItem
public class BucketItem extends Item implements class_5633
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.Settings -
Field Summary
Fields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group -
Constructor Summary
Constructors Constructor Description BucketItem(Fluid fluid, Item.Settings settings) -
Method Summary
Modifier and Type Method Description protected ItemStackgetEmptiedStack(ItemStack stack, PlayerEntity player)voidonEmptied(World world, ItemStack itemStack, BlockPos blockPos)booleanplaceFluid(PlayerEntity playerEntity, World world, BlockPos blockPos, BlockHitResult blockHitResult)protected voidplayEmptyingSound(PlayerEntity player, WorldAccess world, BlockPos pos)TypedActionResult<ItemStack>use(World world, PlayerEntity user, Hand hand)Called when an item is used by a player.Methods inherited from class net.minecraft.item.Item
appendStacks, appendTooltip, asItem, byRawId, canMine, canRepair, damage, finishUsing, fromBlock, getAttributeModifiers, getDefaultStack, getDrinkSound, getEatSound, getEnchantability, getFoodComponent, getGroup, getItemBarColor, getItemBarStep, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getTranslationKey, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, hasStoredInventory, inventoryTick, isDamageable, isEffectiveOn, isEnchantable, isFireproof, isFood, isIn, isItemBarVisible, isNetworkSynced, isUsedOnRelease, method_31570, method_32346, onClicked, onCraft, onStackClicked, onStoppedUsing, postHit, postMine, postProcessTag, raycast, shouldSyncTagToClient, toString, usageTick, useOnBlock, useOnEntity
-
Field Details
-
fluid
-
-
Constructor Details
-
BucketItem
-
-
Method Details
-
use
Called when an item is used by a player. The use action, by default, is bound to the right mouse button.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
world.isClient().- Overrides:
usein classItem- Parameters:
world- the world the item was used inuser- the player who used the itemhand- the hand used- Returns:
- a typed action result that specifies whether using the item was successful. The action result contains the new item stack that the player's hand will be set to.
-
getEmptiedStack
-
onEmptied
- Specified by:
onEmptiedin interfaceclass_5633
-
placeFluid
public boolean placeFluid(@Nullable PlayerEntity playerEntity, World world, BlockPos blockPos, @Nullable BlockHitResult blockHitResult)- Specified by:
placeFluidin interfaceclass_5633
-
playEmptyingSound
-