Package net.minecraft.item
Class PotatoPeelerItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.PotatoPeelerItem
- All Implemented Interfaces:
ItemConvertible,ToggleableFeature
- Mappings:
Namespace Name official cvfintermediary net/minecraft/class_9536named net/minecraft/item/PotatoPeelerItem
-
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, DEFAULT_MAX_COUNT, ITEM_BAR_STEPS, MAX_MAX_COUNTFields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanMine(BlockState state, World world, BlockPos pos, PlayerEntity miner) Returns whether a player can break a block while holding the item.static AttributeModifiersComponentcreateAttributeModifiersComponent(int attackDamage, float attackSpeed) private static floatgetRandomSoundPitch(World world) private static ActionResultpeelBlock(ItemUsageContext context, ItemStack peelsStack, BlockState resultState) static voidplayPeelBlockSound(World world, @Nullable PlayerEntity player, BlockPos pos, SoundCategory category) static voidplayPeelEntitySound(World world, Entity entity) static voidplayPeelSheepSound(World world, Entity entity, SoundCategory category) booleanpostHit(ItemStack stack, LivingEntity target, LivingEntity attacker) Called on the server when the item is used to hit an entity.useOnBlock(ItemUsageContext context) Called when an item is used on a block.Methods inherited from class net.minecraft.item.Item
appendTooltip, asItem, byRawId, canBeNested, canRepair, finishUsing, fromBlock, getAttributeModifiers, getBonusAttackDamage, getBreakSound, getComponents, getDefaultStack, getDrinkSound, getEnchantability, getItemBarColor, getItemBarStep, getMaxCount, getMaxUseTime, getMiningSpeed, getName, getName, getOrCreateTranslationKey, getRawId, getRecipeRemainder, getRegistryEntry, getRequiredFeatures, getTooltipData, getTranslationKey, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, inventoryTick, isCorrectForDrops, isEnchantable, isItemBarVisible, isNetworkSynced, isUsedOnRelease, onClicked, onCraft, onCraftByPlayer, onItemEntityDestroyed, onStackClicked, onStoppedUsing, onViewInChest, postMine, postProcessComponents, raycast, toString, translationKey, usageTick, use, useOnEntityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
isEnabled
-
Constructor Details
-
PotatoPeelerItem
- Mappings:
Namespace Name Mixin selector official <init>Lcuc;<init>(Lcuc$a;)Vintermediary <init>Lnet/minecraft/class_1792;<init>(Lnet/minecraft/class_1792$class_1793;)Vnamed <init>Lnet/minecraft/item/Item;<init>(Lnet/minecraft/item/Item$Settings;)V
-
-
Method Details
-
canMine
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:
canMinein classItem- Returns:
- whether a player can break a block while holding the item
- Mappings:
Namespace Name Mixin selector official aLcuc;a(Ldtc;Ldca;Lir;Lcly;)Zintermediary method_7885Lnet/minecraft/class_1792;method_7885(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;)Znamed canMineLnet/minecraft/item/Item;canMine(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;)Z
-
postHit
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:
postHitin classItem- Returns:
- whether the item's use stat should be incremented
- See Also:
- Mappings:
Namespace Name Mixin selector official aLcuc;a(Lcuh;Lbso;Lbso;)Zintermediary method_7873Lnet/minecraft/class_1792;method_7873(Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;Lnet/minecraft/class_1309;)Znamed postHitLnet/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 aLcvf;a(IF)Lcxl;intermediary method_59060Lnet/minecraft/class_9536;method_59060(IF)Lnet/minecraft/class_9285;named createAttributeModifiersComponentLnet/minecraft/item/PotatoPeelerItem;createAttributeModifiersComponent(IF)Lnet/minecraft/component/type/AttributeModifiersComponent;
-
getRandomSoundPitch
- Mappings:
Namespace Name Mixin selector official aLcvf;a(Ldca;)Fintermediary method_59062Lnet/minecraft/class_9536;method_59062(Lnet/minecraft/class_1937;)Fnamed getRandomSoundPitchLnet/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 aLcvf;a(Ldca;Lcly;Lir;Lavq;)Vintermediary method_59065Lnet/minecraft/class_9536;method_59065(Lnet/minecraft/class_1937;Lnet/minecraft/class_1657;Lnet/minecraft/class_2338;Lnet/minecraft/class_3419;)Vnamed playPeelBlockSoundLnet/minecraft/item/PotatoPeelerItem;playPeelBlockSound(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/sound/SoundCategory;)V
-
playPeelEntitySound
- Mappings:
Namespace Name Mixin selector official aLcvf;a(Ldca;Lbrv;)Vintermediary method_59063Lnet/minecraft/class_9536;method_59063(Lnet/minecraft/class_1937;Lnet/minecraft/class_1297;)Vnamed playPeelEntitySoundLnet/minecraft/item/PotatoPeelerItem;playPeelEntitySound(Lnet/minecraft/world/World;Lnet/minecraft/entity/Entity;)V
-
playPeelSheepSound
- Mappings:
Namespace Name Mixin selector official aLcvf;a(Ldca;Lbrv;Lavq;)Vintermediary method_59064Lnet/minecraft/class_9536;method_59064(Lnet/minecraft/class_1937;Lnet/minecraft/class_1297;Lnet/minecraft/class_3419;)Vnamed playPeelSheepSoundLnet/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 aLcvf;a(Lcyf;Lcuh;Ldtc;)Lbqa;intermediary method_59061Lnet/minecraft/class_9536;method_59061(Lnet/minecraft/class_1838;Lnet/minecraft/class_1799;Lnet/minecraft/class_2680;)Lnet/minecraft/class_1269;named peelBlockLnet/minecraft/item/PotatoPeelerItem;peelBlock(Lnet/minecraft/item/ItemUsageContext;Lnet/minecraft/item/ItemStack;Lnet/minecraft/block/BlockState;)Lnet/minecraft/util/ActionResult;
-
useOnBlock
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:
useOnBlockin classItem- 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 aLcuc;a(Lcyf;)Lbqa;intermediary method_7884Lnet/minecraft/class_1792;method_7884(Lnet/minecraft/class_1838;)Lnet/minecraft/class_1269;named useOnBlockLnet/minecraft/item/Item;useOnBlock(Lnet/minecraft/item/ItemUsageContext;)Lnet/minecraft/util/ActionResult;
-