Data on /give

This commit is contained in:
2026-10-25 15:42:20 -03:00
parent 583cce88c1
commit feb1ddd1f7
7 changed files with 121 additions and 25 deletions
+21 -11
View File
@@ -50,16 +50,17 @@ That's `/heal`, `/heal 5` and `/heal 5 alice`.
## Argument Types
| `types.` | Reads | Suggests |
| --------------------- | --------------------------------------------------------------- | -------------- |
| `integer(min?, max?)` | a whole number | |
| `number(min?, max?)` | any number | |
| `boolean()` | `true` or `false` | both |
| `word()` | one word | |
| `greedy_string()` | the rest of the line, spaces and all. Nothing can come after it | |
| `choice([...])` | one of the given words | them |
| `item()`, `block()` | an id. `carrot` works too, while only one mod has a `carrot` | ids |
| `player()` | an online player's name, as a `Player` | online players |
| `types.` | Reads | Suggests |
| ------------------------------ | --------------------------------------------------------------- | -------------- |
| `integer(min?, max?)` | a whole number | |
| `number(min?, max?)` | any number | |
| `boolean()` | `true` or `false` | both |
| `word()` | one word | |
| `greedy_string()` | the rest of the line, spaces and all. Nothing can come after it | |
| `json()` | a JSON value, the rest of the line like `greedy_string()` | |
| `choice([...])` | one of the given words | them |
| `item()`, `block()`, `fluid()` | an id. `carrot` works too, while only one mod has a `carrot` | ids |
| `player()` | an online player's name, as a `Player` | online players |
## Errors
@@ -107,7 +108,8 @@ Commands can only be registered during `setup`.
| Command | What it does |
| ------------------------------------------------------- | -------------------------------------------------------------------- |
| `/give <item> [count]` | Gives you an item |
| `/give <item> [count] [data]` | Gives you an item, with `data` as JSON |
| `/give <item> <count> fluid <fluid> [data]` | Gives you a fluid container full of the fluid, with the fluid's data |
| `/effect <effect> [seconds]` | Gives you a status effect, for 30 seconds by default |
| `/summon <entity>` | Spawns an entity where you are |
| `/time` | Shows the time |
@@ -120,3 +122,11 @@ Commands can only be registered during `setup`.
| `/viewdistance [chunks]` | Shows or changes how far the server sends chunks, until it restarts |
| `/skin [url] [slim\|normal]` | Changes your skin to a 64×64 PNG, or back to the default |
| `/help [command]` | Every command's usage, or one's |
`/give`'s data is the stack's `data`, and with `fluid` it's the fluid's (see
[Fluids](../resources/fluids.md#containers)):
```
/give bworld:wood_pickaxe 1 {"damage": 5}
/give bworld:glass_bottle 3 fluid bworld:juice {"item": "bworld:strawberry"}
```