Package net.minecraft.world.item
Class ShieldItem
java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.ShieldItem
- All Implemented Interfaces:
FeatureElement
,Equipable
,ItemLike
,IItemExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.Item
Item.Properties, Item.TooltipContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final float
Fields inherited from class net.minecraft.world.item.Item
ABSOLUTE_MAX_STACK_SIZE, BASE_ATTACK_DAMAGE_ID, BASE_ATTACK_SPEED_ID, BY_BLOCK, canRepair, DEFAULT_MAX_STACK_SIZE, MAX_BAR_WIDTH
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendHoverText
(ItemStack pStack, Item.TooltipContext pContext, List<Component> pTooltipComponents, TooltipFlag pTooltipFlag) boolean
canPerformAction
(ItemStack stack, ItemAbility itemAbility) Queries if an item can perform the given action.getDescriptionId
(ItemStack pStack) Returns the unlocalized name of this item.getUseAnimation
(ItemStack pStack) Returns the action that specifies what animation to play when the item is being used.int
getUseDuration
(ItemStack pStack, LivingEntity pEntity) boolean
isValidRepairItem
(ItemStack pToRepair, ItemStack pRepair) Return whether this item is repairable in an anvil.use
(Level pLevel, Player pPlayer, InteractionHand pHand) Called to trigger the item's "innate" right click behavior.Methods inherited from class net.minecraft.world.item.Item
asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canFitInsideContainerItems, components, finishUsingItem, getAttackDamageBonus, getBarColor, getBarWidth, getBreakingSound, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDefaultMaxStackSize, getDescription, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getEnchantmentValue, getId, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getTooltipImage, hasCraftingRemainingItem, hurtEnemy, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isEnchantable, isFoil, isRepairable, mineBlock, modifyDefaultComponentsFrom, onCraftedBy, onCraftedPostProcess, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, postHurtEnemy, releaseUsing, requiredFeatures, toString, useOn, useOnRelease, verifyComponentsAfterLoad
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.item.Equipable
getEquipSound, swapWithEquipmentSlot
Methods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
Methods inherited from interface net.neoforged.neoforge.common.extensions.IItemExtension
applyEnchantments, canBeHurtBy, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getDefaultAttributeModifiers, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, isBookEnchantable, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, isPrimaryItemFor, makesPiglinsNeutral, onAnimalArmorTick, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onEntitySwing, onItemUseFirst, onLeftClickEntity, onStopUsing, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, supportsEnchantment
-
Field Details
-
EFFECTIVE_BLOCK_DELAY
public static final int EFFECTIVE_BLOCK_DELAY- See Also:
-
MINIMUM_DURABILITY_DAMAGE
public static final float MINIMUM_DURABILITY_DAMAGE- See Also:
-
-
Constructor Details
-
ShieldItem
-
-
Method Details
-
getDescriptionId
Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different names based on their damage or NBT.- Overrides:
getDescriptionId
in classItem
-
appendHoverText
public void appendHoverText(ItemStack pStack, Item.TooltipContext pContext, List<Component> pTooltipComponents, TooltipFlag pTooltipFlag) - Overrides:
appendHoverText
in classItem
-
getUseAnimation
Returns the action that specifies what animation to play when the item is being used.- Overrides:
getUseAnimation
in classItem
-
getUseDuration
- Overrides:
getUseDuration
in classItem
-
use
Called to trigger the item's "innate" right click behavior. To handle when this item is used on a Block, seeinvalid reference
#onItemUse
-
isValidRepairItem
Return whether this item is repairable in an anvil.- Overrides:
isValidRepairItem
in classItem
-
getEquipmentSlot
- Specified by:
getEquipmentSlot
in interfaceEquipable
-
canPerformAction
Description copied from interface:IItemExtension
Queries if an item can perform the given action. SeeItemAbilities
for a description of each stock action- Specified by:
canPerformAction
in interfaceIItemExtension
- Parameters:
stack
- The stack being useditemAbility
- The action being queried- Returns:
- True if the stack can perform the action
-