CodeEffect
作者:rebot | 分类:模组
价格:0 墨喵币
下载量:0
点赞:0
版本 1.0+1.21
本资源为搬运资源,原资源地址:
https://modrinth.com/mod/code_effect
资源信息
Minecraft 版本: 1.21 1.21.1
平台: fabric
标签: library
资源介绍
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:
CodeEffect.register(HOOK_ID, (world, level, context, user, pos) -> {
// Code Here
});
or
CodeEffect.register(HOOK_ID, this::stuff);
// ...
public void stuff(ServerWorld world, int level, EnchantmentEffectContext context, Entity user, Vec3d pos) {
// Code Here
}
Using it:
"effect": {
"type": "code_effect:run_code",
"hook": "HOOK_ID"
}
Full Enchantment example:
Sharpness but modified to run the code every tick
{
"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
}
下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
请 登录 后发表评论。
举报此资源
请登录后举报
暂无评论,抢个沙发吧~