Skip to content

v0.10.0

Choose a tag to compare

@github-actions github-actions released this 15 Nov 16:57
· 107 commits to main since this release

Feature

  • Added bolt_expressions.contrib.commands. This plugin extends the command tree to let interpolation of Source objects as command arguments. For all registered commands, any sequence of arguments <score_holder> <objective> or entity|block|storage <entity|block_pos|resource_location> <nbt_path> can be replaced by var <source>, var being a literal value and source a variable identifier or a tuple. (e40ae95)
obj = Scoreboard("my.obj")
strg = Data.storage(example:test)
player = Data.entity("@s")
block = Data.block("~  ~  ~")

value = obj["$value"]

if score value.scoreholder value.objective matches 10
# can be written as
if score var value matches 10

if score var obj["$a"] = var obj["$b"]
if score $a obj = var obj["$b"]
if score var obj["$a"] = $b obj

scoreboard players add var value 10
scoreboard players remove var value 3

store success score var value time query daytime

if data var block.Items[{id:"minecraft:diamond"}]
# execute if data block ~ ~ ~ Items[{id:"minecraft:diamond"}]

data modify var strg.items set from var block.Items
# data modify storage example:main items set from block ~ ~ ~ Items

store result var strg.value float 0.01 scoreboard players get var value

# score tuples: (scoreholder, objective)
if score var ("$value", "my.obj") matches 10

# data tuples: (type, target, path)
if data var ("entity", "@s", "Inventory[{Slot:0b}].id")
  • The plugin bolt_expressions.contrib.commands is required by default. Set meta.bolt_expressions.disable_commands to true to make it optional. (f748ee3)
meta:
    bolt_expressions:
        disable_commands: true
# can still be enabled by requiring it explicitly in the config
require:
    - bolt_expressions.contrib.commands