zh_cn:tutorial:items_docs
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
zh_cn:tutorial:items_docs [2020/10/31 15:27] – part one [WIP] 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 11: | Line 12: | ||
| maxDamageIfAbsent | '' | | maxDamageIfAbsent | '' | ||
| 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 '' | + | 如果之前还没有调用过'' |
---- | ---- | ||
- | ==== Max Damage | + | ==== 最大耐久度 |
<code java> | <code java> | ||
public Item.Settings maxDamage(int maxDamage) | public Item.Settings maxDamage(int maxDamage) | ||
</ | </ | ||
- | '' | + | '' |
---- | ---- | ||
- | ==== Recipe Remainder | + | ==== 合成剩余物 |
<code java> | <code java> | ||
public Item.Settings recipeRemainder(Item recipeRemainder) | public Item.Settings recipeRemainder(Item recipeRemainder) | ||
</ | </ | ||
- | '' | + | '' |
- | When a recipe remainder is set on an Item, any recipe using that Item will return the remainder on craft. This is used for buckets (Water, Lava, Milk) and bottles (Dragon Breath, Honey) returning their respective empty items when used in recipes. | + | 有设置了合成剩余物的物品在合成后会将剩余物返回给玩家。设置了该属性的物品有桶(熔岩、水、牛奶)和瓶子(龙息、蜂蜜),合成过后则会返回对应的空物品。 |
---- | ---- | ||
- | ==== Group ==== | + | |
+ | ==== 稀有度 | ||
<code java> | <code java> | ||
- | public Item.Settings | + | public Item.Settings |
</ | </ | ||
- | '' | + | '' |
- | Each ItemGroup appears as a tab in the creative inventory. Adding an Item to this group will add it to the tab. The order of the group is based on registry order. For more information on creating a group, see the [[tutorial: | + | 有自定义的稀有度的物品名称会变成不同的颜色。 |
+ | ^ 稀有度 ^ 字体颜色 ^ | ||
+ | | 常见 | 白色 | | ||
+ | | 少见 | 黄色 | | ||
+ | | 稀有 | 青色 | | ||
+ | | 史诗 | 淡紫色 | ||
- | ---- | + | ==== 防火 |
- | + | ||
- | ==== Rarity | + | |
<code java> | <code java> | ||
- | public Item.Settings | + | public Item.Settings |
</ | </ | ||
- | '' | ||
- | If Rarity is set, the given Item will have a custom name color. An Item's Rarity defaults to common. | + | 使物品防火,包含此物品的物品实体不被火和熔岩烧毁。 |
- | ^ Rarity ^ Color ^ | + | |
- | | Common | White | | + | |
- | | Uncommon | Yellow | | + | |
- | | Rare | Aqua | | + | |
- | | Epic | Light Purple | | + |
zh_cn/tutorial/items_docs.1604158058.txt.gz · Last modified: 2020/10/31 15:27 by leocth2