CodeEffect
⚪ Last updated 2024⚠️ Install Order · 2 steps
Install in this order, then this mod last — most mods fail to load without their framework and dependencies in place.
Preview

🔍 Analysis
- 🏆 #622 of 876 fabric mods in this game by downloads
📋 About This Mod
### For Users This mod doesn't do anything on its own. This library allows mods to call code in data-driven enchantments. ### For Devs **Registering your code:** ```java CodeEffect.register(HOOK_ID, (world, level, context, user, pos) -> { // Code Here }); ``` or ```java CodeEffect.register(HOOK_ID, this::stuff); // ... public void stuff(ServerWorld world, int level, EnchantmentEffectContext context, Entity user, Vec3d pos) { // Code Here } ``` **Using it:** ```json "effect": { "type": "code_effect:run_code", "hook": "HOOK_ID" } ``` Full Enchantment example: *Sharpness but modified to run the code every tick* ```json { "anvil_cost": 1, "description": { "translate": "enchantment.minecraft.sharpness" }, "effects": { "minecraft:tick": }, "exclusive_set": "#minecraft:exclusive_set/damage", "max_cost": { "base": 21, "per_level_above_first": 11 }, "max_level": 5, "min_cost": { "base": 1, "per_level_above_first": 11 }, "primary_items": "#minecraft:enchantable/sword", "slots": , "supported_items": "#minecraft:enchantable/weapon", "weight": 10 } ```
### For Users This mod doesn't do anything on its own. This library allows mods to call code in data-driven enchantments.
### For Devs Registering your code: ```java CodeEffect.register(HOOK_ID, (world, level, context, user, pos) -> { // Code Here }); ``` or ```java CodeEffect.register(HOOK_ID, this::stuff); // ... public void stuff(ServerWorld world, int level, EnchantmentEffectContext context, Entity user, Vec3d pos) { // Code Here } ```
Using it: ```json "effect": { "type": "code_effect:run_code", "hook": "HOOK_ID" } ```
Full Enchantment example: Sharpness but modified to run the code every tick ```json { "anvil_cost": 1, "description": { "translate": "enchantment.minecraft.sharpness" }, "effects": { "minecraft:tick": [ { "effect": { "type": "code_effect:run_code", "hook": "HOOK_ID" } } ] }, "exclusive_set": "#minecraft:exclusive_set/damage", "max_cost": { "base": 21, "per_level_above_first": 11 }, "max_level": 5, "min_cost": { "base": 1, "per_level_above_first": 11 }, "primary_items": "#minecraft:enchantable/sword", "slots": [ "mainhand" ], "supported_items": "#minecraft:enchantable/weapon", "weight": 10 } ```
📊 Mod Details
- Game
- Minecraft Mods
- Author
- Minenash
- Version
- 1.0+1.21
- Downloads
- 320
- Endorsements
- 7
- Category
- fabric
- Created
- 5/6/2024
- Updated
- 7/8/2024
- Game Versions
- 1.21, 1.21.1
- Tags
- library
🔧 How to Install Minecraft Mods Mods
Download from Modrinth. Use Prism Launcher or drop into your mods folder.
📖 Full step-by-step install guide for Minecraft Mods →
Visit the official mod page for specific installation instructions for this mod.
🎮 Need cheat codes or console commands? Check ur gaming wiki for Minecraft Mods commands, item IDs, and more.
❓ Frequently Asked Questions
Which Minecraft Mods versions does CodeEffect support?
The author lists 1.21, 1.21.1. Other versions may work but are untested by the author.
What is the latest version of CodeEffect?
Version 1.0+1.21, published 2024-07-08 with 320 downloads recorded at the source.
Keep browsing — more Minecraft Mods mods await