Package net.mcreator.element.types
Class Item
java.lang.Object
net.mcreator.element.GeneratableElement
net.mcreator.element.types.Item
- All Implemented Interfaces:
ICommonType
,IItem
,IItemWithModel
,IItemWithTexture
,IMCItemProvider
,ISpecialInfoHolder
,ITabContainedElement
public class Item
extends GeneratableElement
implements IItem, IItemWithModel, ITabContainedElement, ISpecialInfoHolder, IItemWithTexture
-
Nested Class Summary
Nested classes/interfaces inherited from class net.mcreator.element.GeneratableElement
GeneratableElement.GSONAdapter, GeneratableElement.Unknown
-
Field Summary
Modifier and TypeFieldDescriptionint
boolean
double
boolean
boolean
boolean
int
boolean
int
int
boolean
boolean
boolean
boolean
int
int
int
boolean
boolean
int
double
boolean
int
boolean
double
int
Fields inherited from class net.mcreator.element.GeneratableElement
formatVersion
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Model.Type
decodeModelType
(int modelType) static int
encodeModelType
(Model.Type modelType) WARNING: Calls to this method are generally not thread safe.Returns a copy ofstates
referencing only properties supported in the current workspace.boolean
boolean
boolean
boolean
boolean
boolean
This method determines what MCItems are provided by this generatable elementMethods inherited from class net.mcreator.element.GeneratableElement
finalizeModElementGeneration, getAdditionalTemplateData, getModElement, isUnknown, performQuickValidation, setModElement, wasConversionApplied
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.mcreator.element.types.interfaces.IItem
getBaseTypesProvided
Methods inherited from interface net.mcreator.element.types.interfaces.IMCItemProvider
getIconForMCItem
Methods inherited from interface net.mcreator.element.types.interfaces.ISpecialInfoHolder
getFixedSpecialInformation
-
Field Details
-
renderType
public int renderType -
texture
-
customModelName
-
customProperties
-
states
-
name
-
rarity
-
creativeTabs
-
stackSize
public int stackSize -
enchantability
public int enchantability -
useDuration
public int useDuration -
toolType
public double toolType -
damageCount
public int damageCount -
recipeRemainder
-
destroyAnyBlock
public boolean destroyAnyBlock -
immuneToFire
public boolean immuneToFire -
stayInGridWhenCrafting
public boolean stayInGridWhenCrafting -
damageOnCrafting
public boolean damageOnCrafting -
enableMeleeDamage
public boolean enableMeleeDamage -
damageVsEntity
public double damageVsEntity -
specialInformation
-
glowCondition
-
guiBoundTo
-
inventorySize
public int inventorySize -
inventoryStackSize
public int inventoryStackSize -
onRightClickedInAir
-
onRightClickedOnBlock
-
onCrafted
-
onEntityHitWith
-
onItemInInventoryTick
-
onItemInUseTick
-
onStoppedUsing
-
onEntitySwing
-
onDroppedByPlayer
-
onFinishUsingItem
-
enableRanged
public boolean enableRanged -
shootConstantly
public boolean shootConstantly -
rangedItemChargesPower
public boolean rangedItemChargesPower -
projectile
-
projectileDisableAmmoCheck
public boolean projectileDisableAmmoCheck -
onRangedItemUsed
-
rangedUseCondition
-
isFood
public boolean isFood -
nutritionalValue
public int nutritionalValue -
saturation
public double saturation -
eatResultItem
-
isMeat
public boolean isMeat -
isAlwaysEdible
public boolean isAlwaysEdible -
animation
-
isMusicDisc
public boolean isMusicDisc -
musicDiscMusic
-
musicDiscDescription
-
musicDiscLengthInTicks
public int musicDiscLengthInTicks -
musicDiscAnalogOutput
public int musicDiscAnalogOutput
-
-
Constructor Details
-
Item
-
-
Method Details
-
generateModElementPicture
- Overrides:
generateModElementPicture
in classGeneratableElement
- Returns:
- BufferedImage of mod element preview or null if default mod element icon should be used
-
getItemModel
- Specified by:
getItemModel
in interfaceIItemWithModel
-
getTextureMap
- Specified by:
getTextureMap
in interfaceIItemWithModel
-
getCreativeTabs
- Specified by:
getCreativeTabs
in interfaceITabContainedElement
-
getTexture
- Specified by:
getTexture
in interfaceIItemWithTexture
-
providedMCItems
Description copied from interface:IMCItemProvider
This method determines what MCItems are provided by this generatable elementWARNING: Calls to this method are generally not thread safe. Implementations can call MCItem.Custom::new that calls getBlockIconBasedOnName which calls ModElement#getGeneratableElement that is not thread safe
- Specified by:
providedMCItems
in interfaceIMCItemProvider
- Returns:
- A list of MCItems provided by this generatable element
-
getCreativeTabItems
Description copied from interface:ITabContainedElement
WARNING: Calls to this method are generally not thread safe. Implementations can call MCItem.Custom::new that calls getBlockIconBasedOnName that calls ModElement#getGeneratableElement which is not thread safe- Specified by:
getCreativeTabItems
in interfaceITabContainedElement
- Returns:
- list of items in the creative tab of this element
-
getSpecialInfoProcedure
- Specified by:
getSpecialInfoProcedure
in interfaceISpecialInfoHolder
-
hasNormalModel
public boolean hasNormalModel() -
hasToolModel
public boolean hasToolModel() -
hasRangedItemModel
public boolean hasRangedItemModel() -
hasInventory
public boolean hasInventory() -
hasNonDefaultAnimation
public boolean hasNonDefaultAnimation() -
hasEatResultItem
public boolean hasEatResultItem() -
getModels
Returns a copy ofstates
referencing only properties supported in the current workspace. Should only be used by generators to filter invalid data.Also populates models with Workspace reference for the use in templates
- Returns:
- Models with contents matching current generator.
-
encodeModelType
-
decodeModelType
-