Skip to content

Commit

Permalink
Add item element and update img and entity
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatGravyBoat committed Nov 19, 2023
1 parent 3c5ec56 commit 313b47a
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 9 deletions.
10 changes: 7 additions & 3 deletions docs/hermes/elements/entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ This element will always be 50 in height and follow the users mouse.
> The type of entity to display.
> The entity must be a living entity.
`tag`
> The nbt tag of the entity to display.
## Examples

The following example will display a cow.
Expand All @@ -25,6 +28,7 @@ The following example will display a cow.

## Version History

| Version | Changes |
| ------- | ------- |
| 1.0 | Initial release. |
| Version | Changes |
|---------|------------------------------|
| 1.3 | Allowed for `tag` attribute. |
| 1.0 | Initial release. |
13 changes: 7 additions & 6 deletions docs/hermes/elements/img.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,22 @@ The `<img>` element is used to display an image.
> The v coordinate of the image. Defaults to 0.
`textureWidth`
> The width of the texture. Defaults to height.
> The width of the texture. Defaults to src width.
`textureHeight`
> The height of the texture. Defaults to width.
> The height of the texture. Defaults to src height.
## Examples

The following example will display a diamond sword.

```html
<img src="minecraft:textures/item/diamond_sword.png" width="16" height="16"/>
<img src="minecraft:textures/item/diamond_sword.png" width="32" height="32"/>
```

## Version History

| Version | Changes |
|---------|------------------|
| 1.0 | Initial release. |
| Version | Changes |
|---------|-------------------------------------------------------|
| 1.3 | Changed to use src width and height if not specified. |
| 1.0 | Initial release. |
35 changes: 35 additions & 0 deletions docs/hermes/elements/item.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
displayed_sidebar: hermes

title: <item>
---

# `<item>` : Item

The `<item>` element is used to display an item.


## Attributes

`id`
> The id of the item to display, in resource location format. Example: `minecraft:diamond_sword`.
`tag`
> The nbt tag of the ItemStack to display.
`scale`
> The scale of the item. Defaults to 1.0.
## Examples

The following example will display a diamond sword with a scale of 2.0.

```html
<item id="minecraft:diamond_sword" scale="2.0"/>
```

## Version History

| Version | Changes |
|---------|------------------------------|
| 1.3 | Initial release. |
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ const sidebars = {
'hermes/elements/headings',
'hermes/elements/hint',
'hermes/elements/hr',
'hermes/elements/item',
'hermes/elements/img',
'hermes/elements/li',
'hermes/elements/ol',
Expand Down

0 comments on commit 313b47a

Please sign in to comment.