Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
Update to 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
melontini committed Jul 15, 2024
1 parent 940f56f commit af04f53
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions docs/Expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Example: `this_entity.attributes.'generic.luck'`

::: details `storage` (Levels, Chunks, Entities, Block Entities)

Allows you to access persistent data storage. The data is modified and written by [`/cmd:data`](/BrigadierCommands#cmd-data), [`commander:store_nbt_data`](/Commands#commander-store-expression-data-and-commander-store-nbt-data) or [`commander:store_expression_data`](/Commands#commander-store-expression-data-and-commander-store-nbt-data)
Allows you to access persistent data storage. The data is modified and written by [`/cmd:data`](/BrigadierCommands#cmd-data)

:::

Expand Down Expand Up @@ -130,18 +130,17 @@ So the output can be: `00:00`, or `13:45`, etc.

The fastest way to get started is to use the `cmd:arithmetica` command. You should wrap your expression with `"` to satisfy Brigadier.

Other places are [command macros](Commands#command-macros), the `commander:arithmetica` number provider and the `commander:expression` predicate.
Other places you can use expressions in:

Using the predicate:
::: details JSON Command Macros

```json
{
"condition": "commander:expression",
"value": "level.isDay"
}
```
Command Macros are explained in detail on the Commands page. [Link](Commands#command-macros)

:::

Using the provider in conditions:
::: details Loot number provider

Using the `commander:arithmetica` provider in conditions:

```json
{
Expand All @@ -156,3 +155,28 @@ Using the provider in conditions:
}
}
```

:::

::: details Loot predicate

Using the `commander:expression` predicate:

```json
{
"condition": "commander:expression",
"value": "level.isDay"
}
```

:::

::: details `execute` command

You can use expressions as predicates in the `execute if` command.

```
/execute if cmd:expression "level.isDay" run say It is day!
```

:::

0 comments on commit af04f53

Please sign in to comment.