Files
netease-modsdk-wiki/docs/mconline/10-addon教程/第08章:自定义武器工具/课程02.简易教学①-没有耐久的镐子.md
boybook 760c2dd9ad 2.6
2025-12-01 20:59:16 +08:00

48 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
front:
hard: 进阶
time: 10分钟
---
# 简易教学①:没有耐久的镐子
#### 作者:境界
```
{
"format_version":"1.10",
"minecraft:item":{
"components":{
"minecraft:max_damage":10,
"minecraft:max_stack_size":1,
"netease:weapon":{
"attack_damage":10,
"enchantment":10,
"level":0,
"speed":1,
"type":"pickaxe"
}
},
"description":{
"category":"Equipment",
"identifier":"design:custom_hatchet"
}
}
}
```
1进入关卡编辑器创建武器和工具组件。
2将工具类型改为镐。
3通过资源管理器进入行为包/netease_items_beh网易版物品文件夹找到自定义物品文件。
4默认情况下由编辑器生成的物品设定文件会自带"minecraft:max_damage"键对,这是掌管道具耐久的组件,我们将这一行删掉。
5进入游戏可以看到镐子在挖掘过程中不产生耐久消耗了。