tutorial:items_docs
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:items_docs [2020/04/01 19:45] – finish Item.Settings method docs draylar | tutorial:items_docs [2023/06/12 16:25] (current) – mineblock11 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | :!: //This page is archived.// | ||
+ | |||
====== Items ====== | ====== Items ====== | ||
- | 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 '' | + | |
+ | 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 '' | ||
===== Item Settings ===== | ===== Item Settings ===== | ||
Line 7: | Line 10: | ||
^ Method | ^ Method | ||
- | | food | FoodComponent | Changes the Item to be edible based on the given '' | + | | food | '' |
- | | maxCount | + | | maxCount |
- | | maxDamageIfAbsent | int | Sets the Item's maximum damage count if it hasn't already been set. | | + | | maxDamageIfAbsent | '' |
- | | maxDamage |int | Sets the Item's max stack durability. | | + | | maxDamage | '' |
- | | recipeRemainder | Item | Sets the Item's recipe remainder, which is given back to the player after the Item is used in a recipe. | | + | | recipeRemainder | '' |
- | | group | ItemGroup | + | | rarity |
- | | rarity | + | | fireproof |
+ | |||
+ | ===== Fabric | ||
+ | The Fabric Item API provides extra methods to set even more attributes. To use it, just replace '' | ||
+ | Heres the list of additional functionalities '' | ||
+ | |||
+ | ^ Method | ||
+ | | equipmentSlot | '' | ||
+ | | customDamage | '' | ||
---- | ---- | ||
Line 21: | Line 32: | ||
public Item.Settings food(FoodComponent foodComponent) | public Item.Settings food(FoodComponent foodComponent) | ||
</ | </ | ||
- | '' | + | '' |
---- | ---- | ||
Line 58: | Line 69: | ||
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. | 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> | ||
- | public Item.Settings group(ItemGroup group) | ||
- | </ | ||
- | '' | ||
- | |||
- | 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: | ||
---- | ---- | ||
Line 83: | Line 84: | ||
| Rare | Aqua | | | Rare | Aqua | | ||
| Epic | Light Purple | | | Epic | Light Purple | | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Fireproof ==== | ||
+ | <code java> | ||
+ | public Item.Settings fireproof() | ||
+ | </ | ||
+ | |||
+ | Marks the item as being fireproof, and protects the item entity that contains the item from fire and lava. |
tutorial/items_docs.1585770334.txt.gz · Last modified: 2020/04/01 19:45 by draylar