Sueta

CustomItemFramework

1.0.0

A simple yet system for generating resourcepacks and managing custom items.

·Plugin


Custom Item Framework:
A framework for easily creating custom items in minecraft. CIF dynamically builds the resourcepack and allows you to host your own resourcepack.

How it works:

  1. When the plugin starts, it creates a server daemon that hosts the resourcepack on the specified port (normally 8080. Configurable in the config)
  2. When the server starts, the plugin compiles all of the registered custom items and their model data and dynamically creates a resourcepack.

For Developers:
To add the project through maven, use:

<repository>
        <id>codemc-repo</id>
        <url>https://repo.codemc.org/repository/maven-public/</url>
    </repository>

    <dependency>
        <groupId>me.zombie_striker</groupId>
        <artifactId>CustomItemFramework</artifactId>
        <version>1.0.0</version>
    </dependency>

Then, all you need to do is store the resourcepack models somewhere in the jar file (For example, a file named "resourcepack" at the base of the plugin), and use the following line to load the resourcepack:

CustomItemFramework.registerResourcepack(MAIN_CLASS.class.getResource("/resourcepack/"));

Then, to create a new item, all you need to do is use the following line:

CustomItemFramework.registerCustomItem(new CustomItem("internalname", MATERIAL,"Displayname",ModelPath,NUMBER,ItemEvents.DEFAULT));

Where:

  • "InternalName" is a custom name given for your item. By convention, it should be all lower case.
  • MATERIAL is the material of the base item that will be used.
  • "Displayname" is the displayname of the custom item.
  • ModelPath is a string which represents the model path. So, for example, if the model is located in the /model/item/ folder, and the model's file name is called "test.json", you would use "item/test"
  • NUMBER is the custom model data ID that will be used for the item.
  • ItemEvents.DEFAULT is the default item events, which means the item does nothing. To make the item do anything, create a new ItemEvent.

Similar projects

Plugin →