Skip to content

Commit c43fcab

Browse files
committed
Added RoseLoot SCore variable loot item and run-as-player for commands
1 parent 5ed4a38 commit c43fcab

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

docs/RoseLoot/item-types.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pools:
9797
```
9898

9999
## Commands
100-
You can run commands for those more exotic actions you want to perform from loot tables.
100+
You can run commands for those more exotic actions you want to perform from loot tables. An optional property called `run-as-player` exists which can be set to true to run the command as the player instead of the console.
101101
```yaml
102102
type: ENTITY
103103
overwrite-existing: none
@@ -114,6 +114,7 @@ pools:
114114
0:
115115
type: command
116116
value: 'say %player% killed a villager at %x% %y% %z% in %world%!'
117+
run-as-player: false
117118
```
118119
You can find valid placeholders to be used within commands on the [Context Placeholders](context-placeholders.md) page.
119120

@@ -458,7 +459,6 @@ type: BLOCK
458459
overwrite-existing: none
459460
conditions:
460461
- 'block-type:#logs'
461-
- 'blocktracker-natural-block'
462462
pools:
463463
0:
464464
entries:
@@ -469,4 +469,31 @@ pools:
469469
skill: woodcutting
470470
give-naturally: true
471471
amount: 1
472+
```
473+
474+
## SCore Variables
475+
[SCore](https://modrinth.com/plugin/score) variables can be set or modified for either a player or globally. `global` defaults to `false`. `variable` needs to be set to a valid SCore variable name. Set `amount` if you are modifying a numerical variable, and use `value` if you are modifying/setting a string variable. If using `value`, an additional optional `set` property (which defaults to `false`) is available to set the value instead of modify it.
476+
```yaml
477+
type: BLOCK
478+
overwrite-existing: none
479+
conditions:
480+
- 'block-type:#logs'
481+
pools:
482+
0:
483+
entries:
484+
0:
485+
items:
486+
0: # Using `amount` to add to a numerical variable
487+
type: score_variable
488+
variable: woodcutting
489+
global: false
490+
amount:
491+
min: 1
492+
max: 3
493+
1: # Using `value` to set a string variable
494+
type: score_variable
495+
variable: last_broken_block
496+
global: false
497+
set: true
498+
value: 'log'
472499
```

0 commit comments

Comments
 (0)