当前位置:网站首页>Minecraft 1.16.5模组开发(五十二) 修改原版生物战利品 (Loot Table)
Minecraft 1.16.5模组开发(五十二) 修改原版生物战利品 (Loot Table)
2022-07-26 14:35:00 【Jay_fearless】
我们今天尝试对原版中的一些生物的掉落物进行修改
1.我们本次修改的是原版中Zombie的掉落物,所以我们需要找到原版Zombie的战利品表:
zombie.json
{
"type": "minecraft:entity",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:set_count",
"count": {
"type": "minecraft:uniform",
"min": 0.0,
"max": 2.0
},
"add": false
},
{
"function": "minecraft:looting_enchant",
"count": {
"type": "minecraft:uniform",
"min": 0.0,
"max": 1.0
}
}
],
"name": "minecraft:rotten_flesh"
}
]
},
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:iron_ingot"
},
{
"type": "minecraft:item",
"name": "minecraft:carrot"
},
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:furnace_smelt",
"conditions": [
{
"condition": "minecraft:entity_properties",
"predicate": {
"flags": {
"is_on_fire": true
}
},
"entity": "this"
}
]
}
],
"name": "minecraft:potato"
}
],
"conditions": [
{
"condition": "minecraft:killed_by_player"
},
{
"condition": "minecraft:random_chance_with_looting",
"chance": 0.025,
"looting_multiplier": 0.01
}
]
}
]
}
战利品的基本参数:
"type": "item",
"name": "minecraft:gold_nugget", # 掉落物的具体名称
"weight": 5, # 掉落权重
"functions": [
{
"function": "set_count",
"count": {
"min": 0, # 一次最少掉几个
"max": 2 # 一次最多掉几个
}
}
2.找到模组的资源包,在src\main\resources\data下新建minecraft包->在minecraft包中新建loot_tables包->在loot_tables包中新建entities包->在entities包中新建我们的zombie.json文件:

zombie.json
{
"type": "minecraft:entity",
"pools": [
{
"name": "main",
"rolls": 1,
"entries": [
{
"type": "item",
"name": "minecraft:gold_nugget",
"weight": 5,
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 2
}
}
]
},
{
"type": "item",
"weight": 5,
"name": "minecraft:diamond",
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 2
}
}
]
},
{
"type": "item",
"weight": 3,
"name": "minecraft:iron_ingot",
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
},
{
"type": "item",
"weight": 5,
"name": "minecraft:emerald",
"functions": [
{
"function": "set_count",
"count": {
"min": 2,
"max": 3
}
}
]
}
]
}
]
}
3.进入游戏调试:
我们给zombie设置为掉落钻石、绿宝石、铁锭等物品:
击杀后掉落情况:

所有掉落物都出现了,符合预期!
边栏推荐
- Error reported by Nacos enabled client
- 《MySQL高级篇》五、InnoDB数据存储结构
- 网络图片转本地导致内核退出
- Realize the full link grayscale based on Apache APIs IX through MSE
- SA-Siam:用于实时目标跟踪的孪生网络
- 研发了 5 年的时序数据库,到底要解决什么问题?
- 基于CAS的SSO单点登录环境搭建
- 1-to-1 live broadcast source code - 1-to-1 voice chat source code
- 【无标题】
- Fill in the questionnaire and receive the prize | we sincerely invite you to fill in the Google play academy activity survey questionnaire
猜你喜欢
随机推荐
CAS based SSO single point client configuration
Introduction to C language must brush the daily question of the collection of 100 questions (1-20)
【文件上传漏洞-06】分布式配置文件攻击实验—以upload-labs-4为例
Figure introduction to neural network core dataset
键盘快捷键操作电脑(自己遇到不会的)
1-to-1 live broadcast source code - 1-to-1 voice chat source code
自编码器 AE(AutoEncoder)程序
Realize the full link grayscale based on Apache APIs IX through MSE
unity透明通道的小技巧
Use of LINGO software
Arithmetic operation and logic operation of image in opencv
SP export map to Maya
Maya imports the model into unity
【整数规划】
[Nuxt 3] (十二) 项目目录结构 1
Instructions for various interfaces of hand-held vibrating wire collector vh03
OpenCV中图像算术操作与逻辑操作
中部“第一城”,长沙“人才引力”从争先到领先
Lingo软件的使用
TransC知识表示模型




![[draw with toolbar]](/img/d4/9cb06599f9a8fe5f8149cb7870c103.png)




