Files
netease-modsdk-wiki/docs/mcguide/20-玩法开发/15-自定义游戏内容/1-自定义物品/7-自定义桶.md
2025-03-18 14:46:12 +08:00

48 lines
1.3 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: 分钟
---
# 自定义桶
## 概述
自定义桶主要用于装载自定义流体,一般需配合自定义流体使用,使用后可以倒出指定的流体方块
- 自定义桶的**custom_item_type**需要设为**bucket**
## 注册
1. 与自定义基础物品的注册1-6步相同
2. 在behavior/netease_items_beh的json中设置custom_item_type为**bucket**
3. 添加自定义桶相关的定义,包括一个必填的**netease:bucket组件**,组件的参数见[json组件](#json组件)。注自定义桶的最大堆叠数为1无法通过max_stack_size进行修改
```json
{
"format_version": "1.10",
"minecraft:item": {
"description": {
"identifier": "customBucket:green_bucket",
"custom_item_type": "bucket"
},
"components": {
"netease:bucket": {
"fill_liquid": "flowing_green_water"
}
}
},
}
```
## JSON组件
### 网易components
* netease:bucket
| 键 | 类型 | 默认值 | 解释 |
| ----------- | ------ | --------------- | ---------------------------- |
| fill_liquid | string | "flowing_water" | 可选使用时倒出的流体方块id |
**注:该流体方块需为自定义流体的动态流体**