-
Notifications
You must be signed in to change notification settings - Fork 0
Creating an effect
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 effect 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.AutoEffect; import pl.olafcio.avoid.mods.annotation_processor.AutoID; import pl.olafcio.avoid.net.effect.Effect; import pl.olafcio.avoid.net.effect.properties.*; import pl.olafcio.avoid.net.effect.values.Category; @AutoEffect @AutoID @_category(Category.NEUTRAL) @_color(0xaa10ff) public class SoftnessEffect extends Effect { @Override public boolean tryApply( World world, Entity entity, @Range(from = 1, to = 256) int amplifier ) { // apply your effect here return true; } }
Of course you need to replace the class name and package.
-
Customize it as you wish;
All effect properties (currently only the category and color) are done with these little underscore (_)-prefixed annotations.
These properties themselves are quite simple, imo. -
Implement the effect;
Add an implementation for thetryApplymethod to actually apply the effect for the player.
©️ 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 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