-
Notifications
You must be signed in to change notification settings - Fork 0
Creating a block
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 a block with the Avoid Framework
-
Create a java class;
You can pick any location within your project source code directory. -
Paste the following code:
package com.example.avoidtmpl; import pl.olafcio.avoid.mods.annotation_processor.AutoBlock; import pl.olafcio.avoid.mods.annotation_processor.AutoBlockItem; import pl.olafcio.avoid.mods.annotation_processor.AutoID; import pl.olafcio.avoid.net.block.Block; import pl.olafcio.avoid.net.block.properties.*; import pl.olafcio.avoid.net.block.values.MapColor; import pl.olafcio.avoid.net.block.values.NoteBlockInstrument; @AutoBlock @AutoBlockItem @AutoID @_strength(0.8F) @_ignitedByLava @_instrument(NoteBlockInstrument.BANJO) public class AlphaDirtBlock extends Block { @Override public MapColor getMapColor() { return MapColor.COLOR_BLACK; } }
Of course you need to replace the class name and package.
-
Customize it as you wish;
I would say the API is quite easy once it clicks, as all block properties are done with these little underscore (_)-prefixed annotations.
You can change the block's map color, tick methods (and maybe more at the time you're reading this) in the class contents itself [by overriding inherited Block methods].
©️ Copyright 2026 Olafcio (on behalf of the AvoidLib org)
📝 Licensed with CC BY-NC (Attribution-NonCommercial)
Avoid Framework
🏚️ 1. Home
📽️ 2. Creating your mod
🌄 3. Adding assets to your mod
🧊 4. Creating a block
✏️ 5. Creating an item
🎯 6. Creating an entity selector
🤖 7. Creating a command