public class Item extends ForgeRegistryEntry<Item> implements IItemProvider, IForgeItem
Modifier and Type | Class and Description |
---|---|
static class |
Item.Properties |
ForgeRegistryEntry.UncheckedRegistryEntry<V extends IForgeRegistryEntry<V>>
Modifier and Type | Field and Description |
---|---|
protected static java.util.UUID |
BASE_ATTACK_DAMAGE_UUID |
protected static java.util.UUID |
BASE_ATTACK_SPEED_UUID |
static java.util.Map<Block,Item> |
BY_BLOCK |
protected boolean |
canRepair |
protected ItemGroup |
category |
private Item |
craftingRemainingItem |
private java.lang.String |
descriptionId |
private Food |
foodProperties |
private boolean |
isFireResistant |
private java.util.function.Supplier<ItemStackTileEntityRenderer> |
ister |
private int |
maxDamage |
private int |
maxStackSize |
protected static java.util.Random |
random |
private Rarity |
rarity |
private ReverseTagWrapper<Item> |
reverseTags |
private java.util.Map<ToolType,java.lang.Integer> |
toolClasses |
delegate
Constructor and Description |
---|
Item(Item.Properties p_i48487_1_) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
allowdedIn(ItemGroup p_194125_1_) |
void |
appendHoverText(ItemStack p_77624_1_,
World p_77624_2_,
java.util.List<ITextComponent> p_77624_3_,
ITooltipFlag p_77624_4_) |
Item |
asItem() |
static Item |
byBlock(Block p_150898_0_)
Deprecated.
|
static Item |
byId(int p_150899_0_) |
boolean |
canAttackBlock(BlockState p_195938_1_,
World p_195938_2_,
BlockPos p_195938_3_,
PlayerEntity p_195938_4_) |
boolean |
canBeDepleted() |
boolean |
canBeHurtBy(DamageSource p_234685_1_) |
void |
fillItemCategory(ItemGroup p_150895_1_,
NonNullList<ItemStack> p_150895_2_) |
ItemStack |
finishUsingItem(ItemStack p_77654_1_,
World p_77654_2_,
LivingEntity p_77654_3_) |
Item |
getCraftingRemainingItem()
Deprecated.
|
com.google.common.collect.Multimap<Attribute,AttributeModifier> |
getDefaultAttributeModifiers(EquipmentSlotType p_111205_1_)
Deprecated.
|
ItemStack |
getDefaultInstance() |
ITextComponent |
getDescription() |
java.lang.String |
getDescriptionId() |
java.lang.String |
getDescriptionId(ItemStack p_77667_1_) |
float |
getDestroySpeed(ItemStack p_150893_1_,
BlockState p_150893_2_) |
SoundEvent |
getDrinkingSound() |
SoundEvent |
getEatingSound() |
int |
getEnchantmentValue() |
Food |
getFoodProperties() |
int |
getHarvestLevel(ItemStack stack,
ToolType tool,
PlayerEntity player,
BlockState blockState)
Queries the harvest level of this item stack for the specified tool class,
Returns -1 if this tool is not of the specified type
|
static int |
getId(Item p_150891_0_) |
ItemGroup |
getItemCategory() |
ItemStackTileEntityRenderer |
getItemStackTileEntityRenderer() |
int |
getMaxDamage()
Deprecated.
|
int |
getMaxStackSize()
Deprecated.
|
ITextComponent |
getName(ItemStack p_200295_1_) |
protected java.lang.String |
getOrCreateDescriptionId() |
protected static BlockRayTraceResult |
getPlayerPOVHitResult(World p_219968_0_,
PlayerEntity p_219968_1_,
RayTraceContext.FluidMode p_219968_2_) |
Rarity |
getRarity(ItemStack p_77613_1_) |
java.util.Set<ResourceLocation> |
getTags()
Retrieves a list of tags names this is known to be associated with.
|
java.util.Set<ToolType> |
getToolTypes(ItemStack stack) |
UseAction |
getUseAnimation(ItemStack p_77661_1_) |
int |
getUseDuration(ItemStack p_77626_1_) |
boolean |
hasCraftingRemainingItem()
Deprecated.
|
boolean |
hurtEnemy(ItemStack p_77644_1_,
LivingEntity p_77644_2_,
LivingEntity p_77644_3_) |
ActionResultType |
interactLivingEntity(ItemStack p_111207_1_,
PlayerEntity p_111207_2_,
LivingEntity p_111207_3_,
Hand p_111207_4_) |
void |
inventoryTick(ItemStack p_77663_1_,
World p_77663_2_,
Entity p_77663_3_,
int p_77663_4_,
boolean p_77663_5_) |
boolean |
is(ITag<Item> p_206844_1_) |
boolean |
isComplex() |
boolean |
isCorrectToolForDrops(BlockState p_150897_1_) |
boolean |
isEdible() |
boolean |
isEnchantable(ItemStack p_77616_1_) |
boolean |
isFireResistant() |
boolean |
isFoil(ItemStack p_77636_1_) |
boolean |
isRepairable(ItemStack stack)
Called by CraftingManager to determine if an item is reparable.
|
boolean |
isValidRepairItem(ItemStack p_82789_1_,
ItemStack p_82789_2_) |
boolean |
mineBlock(ItemStack p_179218_1_,
World p_179218_2_,
BlockState p_179218_3_,
BlockPos p_179218_4_,
LivingEntity p_179218_5_) |
void |
onCraftedBy(ItemStack p_77622_1_,
World p_77622_2_,
PlayerEntity p_77622_3_) |
void |
onUseTick(World p_219972_1_,
LivingEntity p_219972_2_,
ItemStack p_219972_3_,
int p_219972_4_) |
void |
releaseUsing(ItemStack p_77615_1_,
World p_77615_2_,
LivingEntity p_77615_3_,
int p_77615_4_) |
boolean |
shouldOverrideMultiplayerNbt() |
java.lang.String |
toString() |
ActionResult<ItemStack> |
use(World p_77659_1_,
PlayerEntity p_77659_2_,
Hand p_77659_3_) |
ActionResultType |
useOn(ItemUseContext p_195939_1_) |
boolean |
useOnRelease(ItemStack p_219970_1_) |
boolean |
verifyTagAfterLoad(CompoundNBT p_179215_1_) |
getRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canHarvestBlock, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getArmorModel, getArmorTexture, getAttributeModifiers, getBurnTime, getBurnTime, getContainerItem, getCreativeTabs, getCreatorModId, getDamage, getDurabilityForDisplay, getEntityLifespan, getEquipmentSlot, getFontRenderer, getHighlightTip, getItem, getItemEnchantability, getItemStackLimit, getMaxDamage, getRGBDurabilityForDisplay, getShareTag, getSmeltingExperience, getXpRepairRatio, hasContainerItem, hasCustomEntity, initCapabilities, isBookEnchantable, isDamageable, isDamaged, isEnderMask, isPiglinCurrency, isShield, makesPiglinsNeutral, onArmorTick, onBlockStartBreak, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onUsingTick, readShareTag, renderHelmetOverlay, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, showDurabilityBar
protected static final java.util.UUID BASE_ATTACK_DAMAGE_UUID
protected static final java.util.UUID BASE_ATTACK_SPEED_UUID
protected static final java.util.Random random
protected final ItemGroup category
private final Rarity rarity
private final int maxStackSize
private final int maxDamage
private final boolean isFireResistant
private final Item craftingRemainingItem
@Nullable private java.lang.String descriptionId
@Nullable private final Food foodProperties
@Nullable private final java.util.function.Supplier<ItemStackTileEntityRenderer> ister
private final java.util.Map<ToolType,java.lang.Integer> toolClasses
private final ReverseTagWrapper<Item> reverseTags
protected final boolean canRepair
public Item(Item.Properties p_i48487_1_)
public static int getId(Item p_150891_0_)
public static Item byId(int p_150899_0_)
public void onUseTick(World p_219972_1_, LivingEntity p_219972_2_, ItemStack p_219972_3_, int p_219972_4_)
public boolean verifyTagAfterLoad(CompoundNBT p_179215_1_)
public boolean canAttackBlock(BlockState p_195938_1_, World p_195938_2_, BlockPos p_195938_3_, PlayerEntity p_195938_4_)
public Item asItem()
asItem
in interface IItemProvider
public ActionResultType useOn(ItemUseContext p_195939_1_)
public float getDestroySpeed(ItemStack p_150893_1_, BlockState p_150893_2_)
public ActionResult<ItemStack> use(World p_77659_1_, PlayerEntity p_77659_2_, Hand p_77659_3_)
public ItemStack finishUsingItem(ItemStack p_77654_1_, World p_77654_2_, LivingEntity p_77654_3_)
@Deprecated public final int getMaxStackSize()
@Deprecated public final int getMaxDamage()
public boolean canBeDepleted()
public boolean hurtEnemy(ItemStack p_77644_1_, LivingEntity p_77644_2_, LivingEntity p_77644_3_)
public boolean mineBlock(ItemStack p_179218_1_, World p_179218_2_, BlockState p_179218_3_, BlockPos p_179218_4_, LivingEntity p_179218_5_)
public boolean isCorrectToolForDrops(BlockState p_150897_1_)
public ActionResultType interactLivingEntity(ItemStack p_111207_1_, PlayerEntity p_111207_2_, LivingEntity p_111207_3_, Hand p_111207_4_)
public ITextComponent getDescription()
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String getOrCreateDescriptionId()
public java.lang.String getDescriptionId()
public java.lang.String getDescriptionId(ItemStack p_77667_1_)
public boolean shouldOverrideMultiplayerNbt()
@Nullable @Deprecated public final Item getCraftingRemainingItem()
@Deprecated public boolean hasCraftingRemainingItem()
public void inventoryTick(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_)
public void onCraftedBy(ItemStack p_77622_1_, World p_77622_2_, PlayerEntity p_77622_3_)
public boolean isComplex()
public int getUseDuration(ItemStack p_77626_1_)
public void releaseUsing(ItemStack p_77615_1_, World p_77615_2_, LivingEntity p_77615_3_, int p_77615_4_)
public void appendHoverText(ItemStack p_77624_1_, @Nullable World p_77624_2_, java.util.List<ITextComponent> p_77624_3_, ITooltipFlag p_77624_4_)
public ITextComponent getName(ItemStack p_200295_1_)
public boolean isFoil(ItemStack p_77636_1_)
public boolean isEnchantable(ItemStack p_77616_1_)
protected static BlockRayTraceResult getPlayerPOVHitResult(World p_219968_0_, PlayerEntity p_219968_1_, RayTraceContext.FluidMode p_219968_2_)
public int getEnchantmentValue()
public void fillItemCategory(ItemGroup p_150895_1_, NonNullList<ItemStack> p_150895_2_)
protected boolean allowdedIn(ItemGroup p_194125_1_)
@Nullable public final ItemGroup getItemCategory()
@Deprecated public com.google.common.collect.Multimap<Attribute,AttributeModifier> getDefaultAttributeModifiers(EquipmentSlotType p_111205_1_)
public boolean isRepairable(ItemStack stack)
IForgeItem
isRepairable
in interface IForgeItem
public java.util.Set<ToolType> getToolTypes(ItemStack stack)
getToolTypes
in interface IForgeItem
public int getHarvestLevel(ItemStack stack, ToolType tool, @Nullable PlayerEntity player, @Nullable BlockState blockState)
IForgeItem
getHarvestLevel
in interface IForgeItem
stack
- This item stack instanceplayer
- The player trying to harvest the given blockstateblockState
- The block to harvestpublic final ItemStackTileEntityRenderer getItemStackTileEntityRenderer()
getItemStackTileEntityRenderer
in interface IForgeItem
public java.util.Set<ResourceLocation> getTags()
IForgeItem
getTags
in interface IForgeItem
public boolean useOnRelease(ItemStack p_219970_1_)
public ItemStack getDefaultInstance()
public boolean isEdible()
@Nullable public Food getFoodProperties()
public SoundEvent getDrinkingSound()
public SoundEvent getEatingSound()
public boolean isFireResistant()
public boolean canBeHurtBy(DamageSource p_234685_1_)