Class BrushItem

java.lang.Object
net.minecraft.item.Item
net.minecraft.item.BrushItem
All Implemented Interfaces:
ItemConvertible, ToggleableFeature

public class BrushItem extends Item
Mappings:
Namespace Name
named net/minecraft/item/BrushItem
intermediary net/minecraft/class_8162
official csu
  • Field Details

    • ANIMATION_DURATION

      public static final int ANIMATION_DURATION
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named ANIMATION_DURATION Lnet/minecraft/item/BrushItem;ANIMATION_DURATION:I
      intermediary field_43390 Lnet/minecraft/class_8162;field_43390:I
      official a Lcsu;a:I
    • MAX_BRUSH_TIME

      private static final int MAX_BRUSH_TIME
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named MAX_BRUSH_TIME Lnet/minecraft/item/BrushItem;MAX_BRUSH_TIME:I
      intermediary field_42683 Lnet/minecraft/class_8162;field_42683:I
      official b Lcsu;b:I
  • Constructor Details

    • BrushItem

      public BrushItem(Item.Settings settings)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/item/Item;<init>(Lnet/minecraft/item/Item$Settings;)V
      intermediary <init> Lnet/minecraft/class_1792;<init>(Lnet/minecraft/class_1792$class_1793;)V
      official <init> Lcul;<init>(Lcul$a;)V
  • Method Details

    • useOnBlock

      public ActionResult useOnBlock(ItemUsageContext context)
      Called when an item is used on a block.

      This method is called on both the logical client and logical server, so take caution when using this method. The logical side can be checked using context.getWorld().isClient().

      Overrides:
      useOnBlock in class Item
      Parameters:
      context - the usage context
      Returns:
      an action result that specifies if using the item on a block was successful.
      Mappings:
      Namespace Name Mixin selector
      named useOnBlock Lnet/minecraft/item/Item;useOnBlock(Lnet/minecraft/item/ItemUsageContext;)Lnet/minecraft/util/ActionResult;
      intermediary method_7884 Lnet/minecraft/class_1792;method_7884(Lnet/minecraft/class_1838;)Lnet/minecraft/class_1269;
      official a Lcul;a(Lcyf;)Lbqr;
    • getUseAction

      public UseAction getUseAction(ItemStack stack)
      Returns the use action the item should perform.
      Overrides:
      getUseAction in class Item
      Returns:
      the use action the item should perform
      Mappings:
      Namespace Name Mixin selector
      named getUseAction Lnet/minecraft/item/Item;getUseAction(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/UseAction;
      intermediary method_7853 Lnet/minecraft/class_1792;method_7853(Lnet/minecraft/class_1799;)Lnet/minecraft/class_1839;
      official b Lcul;b(Lcuq;)Lcwo;
    • getMaxUseTime

      public int getMaxUseTime(ItemStack stack, LivingEntity user)
      Returns the maximum use (right-click) time of this item, in ticks. Once a player has used an item for said number of ticks, they stop using it, and Item.finishUsing(net.minecraft.item.ItemStack, net.minecraft.world.World, net.minecraft.entity.LivingEntity) is called.
      Overrides:
      getMaxUseTime in class Item
      Returns:
      the maximum use (right-click) time of this item, in ticks
      Mappings:
      Namespace Name Mixin selector
      named getMaxUseTime Lnet/minecraft/item/Item;getMaxUseTime(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;)I
      intermediary method_7881 Lnet/minecraft/class_1792;method_7881(Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;)I
      official a Lcul;a(Lcuq;Lbtn;)I
    • usageTick

      public void usageTick(World world, LivingEntity user, ItemStack stack, int remainingUseTicks)
      Called on both the server and the client every tick while an entity uses the item. Currently used by CrossbowItem to charge the crossbow. If this is overridden, getMaxUseTime(net.minecraft.item.ItemStack, net.minecraft.entity.LivingEntity) should also be overridden to return a positive value.
      Overrides:
      usageTick in class Item
      Parameters:
      remainingUseTicks - how long it's left until the entity finishes using the item, in ticks
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named usageTick Lnet/minecraft/item/Item;usageTick(Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;I)V
      intermediary method_7852 Lnet/minecraft/class_1792;method_7852(Lnet/minecraft/class_1937;Lnet/minecraft/class_1309;Lnet/minecraft/class_1799;I)V
      official a Lcul;a(Ldcw;Lbtn;Lcuq;I)V
    • getHitResult

      private HitResult getHitResult(PlayerEntity user)
      Mappings:
      Namespace Name Mixin selector
      named getHitResult Lnet/minecraft/item/BrushItem;getHitResult(Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/util/hit/HitResult;
      intermediary method_49999 Lnet/minecraft/class_8162;method_49999(Lnet/minecraft/class_1657;)Lnet/minecraft/class_239;
      official a Lcsu;a(Lcmx;)Lexa;
    • addDustParticles

      private void addDustParticles(World world, BlockHitResult hitResult, BlockState state, Vec3d userRotation, Arm arm)
      Mappings:
      Namespace Name Mixin selector
      named addDustParticles Lnet/minecraft/item/BrushItem;addDustParticles(Lnet/minecraft/world/World;Lnet/minecraft/util/hit/BlockHitResult;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Vec3d;Lnet/minecraft/util/Arm;)V
      intermediary method_49184 Lnet/minecraft/class_8162;method_49184(Lnet/minecraft/class_1937;Lnet/minecraft/class_3965;Lnet/minecraft/class_2680;Lnet/minecraft/class_243;Lnet/minecraft/class_1306;)V
      official a Lcsu;a(Ldcw;Lewy;Ldtc;Lexc;Lbtg;)V