public class Item extends ForgeRegistryEntry<Item> implements IItemProvider, IForgeItem
Modifier and Type | Class and Description |
---|---|
static class |
Item.Properties |
Modifier and Type | Field and Description |
---|---|
protected static java.util.UUID |
ATTACK_DAMAGE_MODIFIER |
protected static java.util.UUID |
ATTACK_SPEED_MODIFIER |
static java.util.Map<Block,Item> |
BLOCK_TO_ITEM |
protected boolean |
canRepair |
private Item |
containerItem |
private static IItemPropertyGetter |
COOLDOWN_GETTER |
private static IItemPropertyGetter |
DAMAGE_GETTER |
private static IItemPropertyGetter |
DAMAGED_GETTER |
private Food |
food |
protected ItemGroup |
group |
private java.util.function.Supplier<ItemStackTileEntityRenderer> |
ister |
private static IItemPropertyGetter |
LEFTHANDED_GETTER |
private int |
maxDamage |
private int |
maxStackSize |
private static IItemPropertyGetter |
MODELDATA_GETTER |
java.util.Map<ResourceLocation,IItemPropertyGetter> |
properties |
protected static java.util.Random |
random |
private Rarity |
rarity |
private ReverseTagWrapper<Item> |
reverseTags |
private java.util.Map<ToolType,java.lang.Integer> |
toolClasses |
private java.lang.String |
translationKey |
delegate
Constructor and Description |
---|
Item(Item.Properties properties) |
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, getAnimationParameters, getArmorModel, getArmorTexture, getAttributeModifiers, getBurnTime, getContainerItem, getCreativeTabs, getCreatorModId, getDamage, getDurabilityForDisplay, getEntityLifespan, getEquipmentSlot, getFontRenderer, getHighlightTip, getItem, getItemEnchantability, getItemStackLimit, getMaxDamage, getRGBDurabilityForDisplay, getShareTag, getSmeltingExperience, getXpRepairRatio, hasContainerItem, hasCustomEntity, initCapabilities, isBeaconPayment, isBookEnchantable, isDamaged, isShield, onArmorTick, onBlockStartBreak, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onUsingTick, readShareTag, renderHelmetOverlay, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, showDurabilityBar
private static final IItemPropertyGetter DAMAGED_GETTER
private static final IItemPropertyGetter DAMAGE_GETTER
private static final IItemPropertyGetter LEFTHANDED_GETTER
private static final IItemPropertyGetter COOLDOWN_GETTER
private static final IItemPropertyGetter MODELDATA_GETTER
protected static final java.util.UUID ATTACK_DAMAGE_MODIFIER
protected static final java.util.UUID ATTACK_SPEED_MODIFIER
protected static final java.util.Random random
public final java.util.Map<ResourceLocation,IItemPropertyGetter> properties
protected final ItemGroup group
private final Rarity rarity
private final int maxStackSize
private final int maxDamage
private final Item containerItem
@Nullable private java.lang.String translationKey
@Nullable private final Food food
@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 properties)
public static int getIdFromItem(Item itemIn)
public static Item getItemById(int id)
public void onUse(World worldIn, LivingEntity livingEntityIn, ItemStack stack, int count)
@Nullable public IItemPropertyGetter getPropertyGetter(ResourceLocation key)
public boolean hasCustomProperties()
public boolean updateItemStackNBT(CompoundNBT nbt)
public boolean canPlayerBreakBlockWhileHolding(BlockState state, World worldIn, BlockPos pos, PlayerEntity player)
public Item asItem()
asItem
in interface IItemProvider
public final void addPropertyOverride(ResourceLocation key, IItemPropertyGetter getter)
public ActionResultType onItemUse(ItemUseContext context)
public float getDestroySpeed(ItemStack stack, BlockState state)
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn)
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, LivingEntity entityLiving)
@Deprecated public final int getMaxStackSize()
@Deprecated public final int getMaxDamage()
public boolean isDamageable()
public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker)
public boolean onBlockDestroyed(ItemStack stack, World worldIn, BlockState state, BlockPos pos, LivingEntity entityLiving)
public boolean canHarvestBlock(BlockState blockIn)
public boolean itemInteractionForEntity(ItemStack stack, PlayerEntity playerIn, LivingEntity target, Hand hand)
public ITextComponent getName()
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String getDefaultTranslationKey()
public java.lang.String getTranslationKey()
public java.lang.String getTranslationKey(ItemStack stack)
public boolean shouldSyncTag()
@Nullable @Deprecated public final Item getContainerItem()
@Deprecated public boolean hasContainerItem()
public void inventoryTick(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected)
public void onCreated(ItemStack stack, World worldIn, PlayerEntity playerIn)
public boolean isComplex()
public int getUseDuration(ItemStack stack)
public void onPlayerStoppedUsing(ItemStack stack, World worldIn, LivingEntity entityLiving, int timeLeft)
public void addInformation(ItemStack stack, @Nullable World worldIn, java.util.List<ITextComponent> tooltip, ITooltipFlag flagIn)
public ITextComponent getDisplayName(ItemStack stack)
public boolean hasEffect(ItemStack stack)
public boolean isEnchantable(ItemStack stack)
protected static RayTraceResult rayTrace(World worldIn, PlayerEntity player, RayTraceContext.FluidMode fluidMode)
public int getItemEnchantability()
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> items)
protected boolean isInGroup(ItemGroup group)
@Nullable public final ItemGroup getGroup()
@Deprecated public com.google.common.collect.Multimap<java.lang.String,AttributeModifier> getAttributeModifiers(EquipmentSlotType equipmentSlot)
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 isCrossbow(ItemStack stack)
public ItemStack getDefaultInstance()
public boolean isFood()
@Nullable public Food getFood()
public SoundEvent getDrinkSound()
public SoundEvent getEatSound()