Items - EpicVon2468/MavityLib GitHub Wiki

Registering items with Mavity Lib

One of Mavity Lib's features is adding methods for you to easily register items without having to create a new method every time. Items should be registered like so:

      public static final Item WiiU = ItemRegistry.registerItem("example_mod_id", "wiiu",
              new Item(PropertyInit.GTOIU));

The first parameter is your mod id (as to allow for this to be used in any mod), the second parameter is the item name, and the third parameter is the actual item itself. Other than the modid parameter, this should work the same as registering an item in any other mod.

Properties with Mavity Lib

In case you haven't noticed already, instead of new FabricItemSettings() or new Item.Settings(), the example code for registering items shows PropertyInit.GTOI. This is a pointer to the PropertyInit, where pre-made item settings can be called on. GTOIU is short for Generic Type One Stack Unbreakable. (Peak naming I know /j) This is to say that, it's a generic item, and you can only have up to 1 of it in your inventory, and it cannot be broken. GTOI can have as many as you want, but can be broken, and GT will stack up to 64. And with that, you should be ready to start making items using Mavity Lib! Make sure to register them somewhere that gets called by the onInitialize method in your main class! (I’m going to assume you know how to do this already).