Skip to content

Commit

Permalink
Update spotlight and item component docs to be closer to their actual…
Browse files Browse the repository at this point in the history
… current behaviour
  • Loading branch information
williewillus committed Sep 16, 2023
1 parent a46db85 commit 43af6a9
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 8 deletions.
5 changes: 0 additions & 5 deletions web/docs/patchouli-advanced/default-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ shows how to craft it, if there's one.

An [ItemStack String](/docs/patchouli-advanced/itemstack-format) representing the item you
want to show. Can be a variable.

Advanced usage of this value is possible. You may use `ore:ORENAME`, to display all items
matching the ore dictionary key ORENAME, or you may display multiple stacks at once by
separating them with commas (e.g. `minecraft:diamond,minecraft:emerald`). In both cases,
they alternate with time.

* **framed** (boolean)

Expand Down
17 changes: 17 additions & 0 deletions web/docs/patchouli-advanced/itemstack-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,20 @@ Any of the following are allowed:
To represent NBT tags with text inside, you can either replace all double quotes (`"`)
with single quotes (`'`), or escape them (`\"`). If you want to write a single quote,
you'll have to double-escape it (`\\'`).

## Multiple Items
In contexts where multiple items are allowed, you can write multiple items out, separated
by commas.

For example:

```
"minecraft:sword,minecraft:stone#64"
```

Item tags may also be specified by prepending the marker `tag:` then writing the tag
ID. This can be interspersed with ordinary items:

```
"minecraft:sword,tag:minecraft:axes,minecraft:stone#64"
```
40 changes: 37 additions & 3 deletions web/docs/patchouli-basics/page-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,44 @@ The text to display on this page, under the entity. This text can be

![Screenshot of spotlight page](/img/pageSpotlight.png)

### **item** (String, _mandatory_)
### **item** (Object or String, _mandatory_)

An [ItemStack String](/docs/patchouli-advanced/itemstack-format) representing the item to
be spotlighted.
The item or items to be spotlit. Can be a JSON object or String.

If a JSON object, follows the [vanilla format for recipe ingredients](https://minecraft.fandom.com/wiki/Recipe#crafting_shaped).

That is, either a JSON object with the key `item` or the key `tag`. If you have any mods
that extend the Ingredient format with additional functionality (e.g. NBT support), it
will be supported here as well.

If a JSON string, follows the Patchouli-specific [ItemStack String
format](/docs/patchouli-advanced/itemstack-format).

Examples:

```json
// vanilla format, single item
{
"type": "patchouli:spotlight",
"item": {
"item": "minecraft:diamond_sword"
}
}

// vanilla format, tag
{
"type": "patchouli:spotlight",
"item": {
"tag": "minecraft:axes"
}
}

// patchouli string format, allowing interspersed items and tags
{
"type": "patchouli:spotlight",
"item": "minecraft:diamond_sword,tag:minecraft:axes,minecraft:diamond_shovel"
}
```

### **title** (String)

Expand Down

0 comments on commit 43af6a9

Please sign in to comment.