Add sell value for every block and item in the game, crazy

This commit is contained in:
2026-10-04 01:09:31 -03:00
parent 67c84e3504
commit 6a6abae0d5
67 changed files with 365 additions and 52 deletions
+35 -14
View File
@@ -39,20 +39,20 @@ down to 0 is gone.
## Properties
| Field | Default | Meaning |
| ----------------- | ------------------- | ----------------------------------------------------------------------------- |
| `id` | required | The item's id. |
| `texture` | required | The texture it's drawn with. |
| `name` | from the id | What players see. `copper_tools:copper_ingot` is "Copper Ingot" when not set. |
| `lore` | none | Tooltip text under the name. `\n` starts a new line. |
| `max_stack` | `64`, `1` for tools | How many fit in one slot. |
| `base_sell_value` | none | What one is worth when sold, a whole number of 0 or more. |
| `places` | none | A block it places when used on a block, like seeds. |
| `tool` | none | Makes it a [tool](tools.md). |
| `food` | none | Makes it [edible](food.md). |
| `data_textures` | none | Other textures, picked by the stack's `data`, see below. |
| `worn` | none | How it looks worn on a player, see [below](#worn-models). |
| `components` | none | [Item components](#item-components) and their parameters. |
| Field | Default | Meaning |
| ----------------- | ------------------- | ------------------------------------------------------------------------------------ |
| `id` | required | The item's id. |
| `texture` | required | The texture it's drawn with. Leave it out to [fill in a block's item](#block-items). |
| `name` | from the id | What players see. `copper_tools:copper_ingot` is "Copper Ingot" when not set. |
| `lore` | none | Tooltip text under the name. `\n` starts a new line. |
| `max_stack` | `64`, `1` for tools | How many fit in one slot. |
| `base_sell_value` | none | What one is worth when sold, a whole number of 0 or more. |
| `places` | none | A block it places when used on a block, like seeds. |
| `tool` | none | Makes it a [tool](tools.md). |
| `food` | none | Makes it [edible](food.md). |
| `data_textures` | none | Other textures, picked by the stack's `data`, see below. |
| `worn` | none | How it looks worn on a player, see [below](#worn-models). |
| `components` | none | [Item components](#item-components) and their parameters. |
### Textures From Data
@@ -101,6 +101,27 @@ Things to know when making one:
- **Porting a Java mod's model**, like Artifacts' `ArmsMeshDefinitions`: Java models measure y down from the top of the
head, bedrock up from the feet. Keep x and z, and make each y `24 - y`, with a box's origin at its bottom.
### Block Items
A block's item only has the block's texture and name. To give it anything else, like `lore` or `base_sell_value`, add an
item file with the block's id and no `texture`. What it sets is added to the block's item, and the rest stays as the
block made it.
`items/copper_block.json`:
```json
{
"format_version": 1,
"item": {
"id": "copper_tools:copper_block",
"base_sell_value": 9
}
}
```
The block has to be in the same mod and can't set `"item": false`, or `check-mods` reports an error and the game won't
load the mod.
## Item Components
Like [block components](../blocks/components.md), item components give items behavior. The server script registers them: