Along with blocks, items are a key component of most mods. While blocks make up the world around you, items are what let you change it.
Creating an Item
Basic items that need no special functionality (think sticks or sugar) don’t need custom classes. You can simply instantiate
Item and call its various setters to set some simple properties.
||Sets which creative tab this item is under. Must be called if this item is meant to be shown on the creative menu. Vanilla tabs can be found in the class
||Sets the maximum damage value for this item. If it’s over
||Sets the maximum stack size.|
||Makes this item impossible to repair, even if it is damageable.|
||Sets this item’s unlocalized name, with “item.” prepended.|
||Adds or removes a pair of harvest class (
The above methods are chainable, unless otherwise stated, meaning they
return this to facilitate calling them in series.
Setting the properties of an item as above only works for simple items. If you want more complicated items, you should subclass Item and override its methods.
Registering an Item
Items must be registered to function.