zh_cn:tutorial:items_docs
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| zh_cn:tutorial:items_docs [2020/11/02 02:59] – bits and pieces leocth2 | zh_cn:tutorial:items_docs [2023/11/18 08:00] (current) – solidblock | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | :!: 此页面已存档。 | ||
| ====== 物品 ====== | ====== 物品 ====== | ||
| - | Items are the pieces of content that appear in your inventory. They can perform actions when you click, act as food, or spawn entities. The following documentation will give you a rundown of the entire | + | 物品是你物品栏中占据一个一个格子的内容。它们可以在右击的时候执行操作,食用,或生成实体。以下是整个'' |
| ===== 物品设置 ===== | ===== 物品设置 ===== | ||
| - | '' | + | '' |
| ^ 方法 | ^ 方法 | ||
| Line 12: | Line 13: | ||
| | maxDamage | '' | | maxDamage | '' | ||
| | recipeRemainder | '' | | recipeRemainder | '' | ||
| - | | group | '' | ||
| | rarity | '' | | rarity | '' | ||
| + | | fireproof | None | 使物品防火,不被熔岩和火破坏。| | ||
| + | |||
| + | ===== Fabric物品设置 ===== | ||
| + | Fabric的物品API提供了一些额外的方法来设置一些其他属性。要使用这些新方法,只需要将'' | ||
| + | 下列是所有'' | ||
| + | |||
| + | ^ 方法 | ||
| + | | equipmentSlot | '' | ||
| + | | customDamage | '' | ||
| ---- | ---- | ||
| - | ==== Food ==== | + | ==== 食物 |
| <code java> | <code java> | ||
| public Item.Settings food(FoodComponent foodComponent) | public Item.Settings food(FoodComponent foodComponent) | ||
| </ | </ | ||
| - | '' | + | '' |
| ---- | ---- | ||
| - | ==== Max Stack Count ==== | + | ==== 最大堆叠数量 |
| <code java> | <code java> | ||
| public Item.Settings maxCount(int maxCount) | public Item.Settings maxCount(int maxCount) | ||
| </ | </ | ||
| - | '' | + | '' |
| ---- | ---- | ||
| - | ==== Max Damage if Absent | + | ==== 若未设置则设置最大耐久度 |
| <code java> | <code java> | ||
| public Item.Settings maxDamageIfAbsent(int maxDamage) | public Item.Settings maxDamageIfAbsent(int maxDamage) | ||
| </ | </ | ||
| - | '' | + | '' |
| - | If '' | + | 如果之前还没有调用过'' |
| ---- | ---- | ||
| Line 57: | Line 66: | ||
| '' | '' | ||
| - | 有设置了合成剩余物的物品在合成后会将剩余物返回给玩家。设置了该属性的物品有桶(岩浆、水、牛奶)和瓶子(龙息、蜂蜜),合成过后则会返回对应的空物品。 | + | 有设置了合成剩余物的物品在合成后会将剩余物返回给玩家。设置了该属性的物品有桶(熔岩、水、牛奶)和瓶子(龙息、蜂蜜),合成过后则会返回对应的空物品。 |
| ---- | ---- | ||
| - | ==== 物品组 ==== | ||
| - | <code java> | ||
| - | public Item.Settings group(ItemGroup group) | ||
| - | </ | ||
| - | '' | ||
| - | |||
| - | 每个物品组都会被显示为创造模式物品栏中的一个标签页,将物品添加进该组则会将该物品加入标签页中,而显示的顺序由注册的顺序决定。若要添加一个新物品组请见[[tutorial: | ||
| - | |||
| - | ---- | ||
| ==== 稀有度 ==== | ==== 稀有度 ==== | ||
| Line 83: | Line 83: | ||
| | 稀有 | 青色 | | | 稀有 | 青色 | | ||
| | 史诗 | 淡紫色 | | | 史诗 | 淡紫色 | | ||
| + | |||
| + | ==== 防火 ==== | ||
| + | <code java> | ||
| + | public Item.Settings fireproof() | ||
| + | </ | ||
| + | |||
| + | 使物品防火,包含此物品的物品实体不被火和熔岩烧毁。 | ||
zh_cn/tutorial/items_docs.1604285985.txt.gz · Last modified: 2020/11/02 02:59 by leocth2