Package net.minecraft.item
Class DebugStickItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.DebugStickItem
- All Implemented Interfaces:
ItemConvertible
public class DebugStickItem extends Item
-
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 DebugStickItem(Item.Settings settings) -
Method Summary
Modifier and Type Method Description booleancanMine(BlockState state, World world, BlockPos pos, PlayerEntity miner)Checks if a player can break a block while holding the item.private static <T> Tcycle(Iterable<T> elements, T current, boolean inverse)private static <T extends Comparable<T>>
BlockStatecycle(BlockState state, Property<T> property, boolean inverse)private static <T extends Comparable<T>>
StringgetValueString(BlockState state, Property<T> property)booleanhasGlint(ItemStack stack)Checks if the glint effect should be applied when the item is rendered.private static voidsendMessage(PlayerEntity player, Text message)private voiduse(PlayerEntity player, BlockState state, WorldAccess world, BlockPos pos, boolean update, ItemStack stack)ActionResultuseOnBlock(ItemUsageContext context)Called when an item is used on a block.Methods inherited from class net.minecraft.item.Item
appendStacks, appendTooltip, asItem, byRawId, canRepair, damage, finishUsing, fromBlock, getAttributeModifiers, getDefaultStack, getDrinkSound, getEatSound, getEnchantability, getEquipSound, getFoodComponent, getGroup, getItemBarColor, getItemBarStep, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getTooltipData, getTranslationKey, getTranslationKey, getUseAction, hasRecipeRemainder, hasStoredInventory, inventoryTick, isDamageable, isEnchantable, isFireproof, isFood, isIn, isItemBarVisible, isNetworkSynced, isSuitableFor, isUsedOnRelease, method_33261, onClicked, onCraft, onStackClicked, onStoppedUsing, postHit, postMine, postProcessTag, raycast, shouldSyncTagToClient, toString, usageTick, use, useOnEntity
-
Constructor Details
-
DebugStickItem
-
-
Method Details
-
hasGlint
Checks if the glint effect should be applied when the item is rendered.By default, returns true if the item has enchantments.
-
canMine
Checks if a player can break a block while holding the item. -
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.
-
use
private void use(PlayerEntity player, BlockState state, WorldAccess world, BlockPos pos, boolean update, ItemStack stack) -
cycle
private static <T extends Comparable<T>> BlockState cycle(BlockState state, Property<T> property, boolean inverse) -
cycle
-
sendMessage
-
getValueString
private static <T extends Comparable<T>> String getValueString(BlockState state, Property<T> property)
-