Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 1.21.4: "Creating Your First Item" #250

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions develop/items/first-item.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@

@[code](@/reference/latest/src/main/resources/assets/fabric-docs-reference/models/item/suspicious_substance.json)

But we're still missing a thing: the item still doesn't load?

### Adding an Item Description {#adding-an-item-description}

Since 1.21.4, Minecraft won't try to guess your item model's location anymore, and so, we need to provide an item description.

Create the item description JSON in the `assets/<mod id here>/items`, with the same name as the item; `suspicious_substance.json`.
@[code](@/reference/latest/src/main/resources/assets/fabric-docs-reference/items/suspicious_substance.json)

### Breaking Down the Model JSON {#breaking-down-the-model-json}

- `parent`: This is the parent model that this model will inherit from. In this case, it's the `item/generated` model.
Expand All @@ -109,6 +118,11 @@

There are alternatives, such as `item/handheld` which is used for items that are held in the player's hand, such as tools.

### Breaking Down the Item Description JSON {#breaking-down-the-item-description-json}

Check failure on line 121 in develop/items/first-item.md

View workflow job for this annotation

GitHub Actions / markdownlint

Headings should be surrounded by blank lines

develop/items/first-item.md:121 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Breaking Down the Item Description JSON {#breaking-down-the-item-description-json}"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md022.md
- `model`: This is the property that contains the reference to our model.

Check failure on line 122 in develop/items/first-item.md

View workflow job for this annotation

GitHub Actions / markdownlint

Lists should be surrounded by blank lines

develop/items/first-item.md:122 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "- `model`: This is the propert..."] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md032.md
- `type`: This is the type of our model. For most items, this should be `minecraft:model`
- `model`: This is the model's identifier. It should have this form: `<mod id here>:item/<item name here>`

Your item should now look like this in-game:

![Item with correct model](/assets/develop/items/first_item_2.png)
Expand Down
Copy link
Member

@IMB11 IMB11 Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been created in the wrong folder (1.20.4 instead of latest), we should also be data generating this instead of just placing raw JSON files.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "mod_id:item/suspicious_substance"
}
}
Loading