Class PotatoPeelerItem

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

public class PotatoPeelerItem extends Item
Mappings:
Namespace Name
official cvf
intermediary net/minecraft/class_9536
named net/minecraft/item/PotatoPeelerItem
  • Constructor Details

    • PotatoPeelerItem

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

    • canMine

      public boolean canMine(BlockState state, World world, BlockPos pos, PlayerEntity miner)
      Returns whether a player can break a block while holding the item.

      This is to check whether the player can start breaking the block in the first place; this does not check if the item is a correct tool to mine the block. Melee weapons should override this to return false, unless it is also intended to be used as a tool.

      Overrides:
      canMine in class Item
      Returns:
      whether a player can break a block while holding the item
      Mappings:
      Namespace Name Mixin selector
      official a Lcuc;a(Ldtc;Ldca;Lir;Lcly;)Z
      intermediary method_7885 Lnet/minecraft/class_1792;method_7885(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;)Z
      named canMine Lnet/minecraft/item/Item;canMine(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;)Z
    • postHit

      public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker)
      Called on the server when the item is used to hit an entity.

      Tools and melee weapons should override this to damage the stack.

      Overrides:
      postHit in class Item
      Returns:
      whether the item's use stat should be incremented
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lcuc;a(Lcuh;Lbso;Lbso;)Z
      intermediary method_7873 Lnet/minecraft/class_1792;method_7873(Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;Lnet/minecraft/class_1309;)Z
      named postHit Lnet/minecraft/item/Item;postHit(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/LivingEntity;)Z
    • createAttributeModifiersComponent

      public static AttributeModifiersComponent createAttributeModifiersComponent(int attackDamage, float attackSpeed)
      Mappings:
      Namespace Name Mixin selector
      official a Lcvf;a(IF)Lcxl;
      intermediary method_59060 Lnet/minecraft/class_9536;method_59060(IF)Lnet/minecraft/class_9285;
      named createAttributeModifiersComponent Lnet/minecraft/item/PotatoPeelerItem;createAttributeModifiersComponent(IF)Lnet/minecraft/component/type/AttributeModifiersComponent;
    • getRandomSoundPitch

      private static float getRandomSoundPitch(World world)
      Mappings:
      Namespace Name Mixin selector
      official a Lcvf;a(Ldca;)F
      intermediary method_59062 Lnet/minecraft/class_9536;method_59062(Lnet/minecraft/class_1937;)F
      named getRandomSoundPitch Lnet/minecraft/item/PotatoPeelerItem;getRandomSoundPitch(Lnet/minecraft/world/World;)F
    • playPeelBlockSound

      public static void playPeelBlockSound(World world, @Nullable @Nullable PlayerEntity player, BlockPos pos, SoundCategory category)
      Mappings:
      Namespace Name Mixin selector
      official a Lcvf;a(Ldca;Lcly;Lir;Lavq;)V
      intermediary method_59065 Lnet/minecraft/class_9536;method_59065(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_2338;Lnet/minecraft/class_3419;)V
      named playPeelBlockSound Lnet/minecraft/item/PotatoPeelerItem;playPeelBlockSound(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/sound/SoundCategory;)V
    • playPeelEntitySound

      public static void playPeelEntitySound(World world, Entity entity)
      Mappings:
      Namespace Name Mixin selector
      official a Lcvf;a(Ldca;Lbrv;)V
      intermediary method_59063 Lnet/minecraft/class_9536;method_59063(Lnet/minecraft/class_1937;Lnet/minecraft/class_1297;)V
      named playPeelEntitySound Lnet/minecraft/item/PotatoPeelerItem;playPeelEntitySound(Lnet/minecraft/world/World;Lnet/minecraft/entity/Entity;)V
    • playPeelSheepSound

      public static void playPeelSheepSound(World world, Entity entity, SoundCategory category)
      Mappings:
      Namespace Name Mixin selector
      official a Lcvf;a(Ldca;Lbrv;Lavq;)V
      intermediary method_59064 Lnet/minecraft/class_9536;method_59064(Lnet/minecraft/class_1937;Lnet/minecraft/class_1297;Lnet/minecraft/class_3419;)V
      named playPeelSheepSound Lnet/minecraft/item/PotatoPeelerItem;playPeelSheepSound(Lnet/minecraft/world/World;Lnet/minecraft/entity/Entity;Lnet/minecraft/sound/SoundCategory;)V
    • peelBlock

      private static ActionResult peelBlock(ItemUsageContext context, ItemStack peelsStack, BlockState resultState)
      Mappings:
      Namespace Name Mixin selector
      official a Lcvf;a(Lcyf;Lcuh;Ldtc;)Lbqa;
      intermediary method_59061 Lnet/minecraft/class_9536;method_59061(Lnet/minecraft/class_1838;Lnet/minecraft/class_1799;Lnet/minecraft/class_2680;)Lnet/minecraft/class_1269;
      named peelBlock Lnet/minecraft/item/PotatoPeelerItem;peelBlock(Lnet/minecraft/item/ItemUsageContext;Lnet/minecraft/item/ItemStack;Lnet/minecraft/block/BlockState;)Lnet/minecraft/util/ActionResult;
    • 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
      official a Lcuc;a(Lcyf;)Lbqa;
      intermediary method_7884 Lnet/minecraft/class_1792;method_7884(Lnet/minecraft/class_1838;)Lnet/minecraft/class_1269;
      named useOnBlock Lnet/minecraft/item/Item;useOnBlock(Lnet/minecraft/item/ItemUsageContext;)Lnet/minecraft/util/ActionResult;