Class BrushItem

java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.BrushItem
All Implemented Interfaces:
FeatureElement, ItemLike, IItemExtension

public class BrushItem extends Item
  • Field Details

  • Constructor Details

  • Method Details

    • useOn

      public InteractionResult useOn(UseOnContext pContext)
      Called when this item is used when targeting a Block
      Overrides:
      useOn in class Item
    • getUseAnimation

      public UseAnim getUseAnimation(ItemStack pStack)
      Returns the action that specifies what animation to play when the item is being used.
      Overrides:
      getUseAnimation in class Item
    • getUseDuration

      public int getUseDuration(ItemStack pStack, LivingEntity pEntity)
      Overrides:
      getUseDuration in class Item
    • onUseTick

      public void onUseTick(Level pLevel, LivingEntity pLivingEntity, ItemStack pStack, int pRemainingUseDuration)
      Called as the item is being used by an entity.
      Overrides:
      onUseTick in class Item
    • calculateHitResult

      private HitResult calculateHitResult(Player pPlayer)
    • spawnDustParticles

      private void spawnDustParticles(Level pLevel, BlockHitResult pHitResult, BlockState pState, Vec3 pPos, HumanoidArm pArm)
    • canPerformAction

      public boolean canPerformAction(ItemStack stack, ItemAbility itemAbility)
      Description copied from interface: IItemExtension
      Queries if an item can perform the given action. See ItemAbilities for a description of each stock action
      Parameters:
      stack - The stack being used
      itemAbility - The action being queried
      Returns:
      True if the stack can perform the action