Skip to content

Creating an item

Olafcio1 edited this page Aug 20, 2026 · 3 revisions

This guide assumes you've already created and setup an Avoid project.
This guide uses meta-programming. Another way may either not be implemented or you may need to figure it out on your own.


§ Making an item with the Avoid Framework


  1. Create a java class;
    You can pick any location within your project source code directory.

  2. Paste the following code:

    package com.example.avoidtmpl;
    
    import pl.olafcio.avoid.mods.annotation_processor.AutoID;
    import pl.olafcio.avoid.mods.annotation_processor.AutoItem;
    import pl.olafcio.avoid.net.item.component.values.Rarity;
    import pl.olafcio.avoid.net.item.custom.Item;
    import pl.olafcio.avoid.net.item.properties.*;
    
    @AutoItem
    @AutoID
    
    @_rarity(Rarity.COMMON)
    @_fireResistant
    @_stacksTo(4)
    
    public class PencilItem extends Item {
    }

    Of course you need to replace the class name and package.

  3. Customize it as you wish;
    I would say the API is quite easy once it clicks, as all item properties are done with these little underscore (_)-prefixed annotations.
    Currently, there's only one inherited method you can override:

    • public ItemStack newStack(ItemStack stack): a method that is invoked for every new itemstack of the item.

Avoid Framework


    🏚️ 1. Home
    📽️ 2. Creating your mod
    🌄 3. Adding assets to your mod
    🧊 4. Creating a block
    💧 5. Creating a fluid
    ✏️ 6. Creating an item
    🎯 7. Creating an entity selector
    🤖 8. Creating a command
    ⌨️ 9. Creating a keybind
    🐺 10. Creating an entity
    🌫️ 11. Creating a fog
    🔩 12. Creating an item component
    🔮 13. Creating an effect

Clone this wiki locally