File Details
0.7.0 (1.20.1)
- B
- Jul 25, 2024
- 878.95 KB
- 16
- 1.20.1
- Fabric
File Name
commander-0.7.0-1.20.1-build.17.jar
Supported Versions
- 1.20.1
Curse Maven Snippet
What's New:
User Changes:
- Added
arrayFindAnyandarrayFindFirstfunctions to expressions. As the name suggests, those functions will try to find an element of an array or returnnullif the array is empty. - Added
chainfunction to expressions. This function operates on the results of the first one and allows chaining multiple function calls together like so://`it` is the result of the previous function, unless there's a lower level lamda. chain(arrayOf(2, 3, 6), arrayMap(it, sqrt(it)), arrayFindFirst(it)); //this is the same as: arrayFindFirst(arrayMap(arrayOf(2, 3, 6), sqrt(it))) - Added
removetocmd:data. - Added
cmd:operateto thescoreboard playerscommand. - Added registry access for expressions! Now you can access the game's static and dynamic content registries by using new
RegistryandDynamicRegistryfunctions.- Why is this useful? For example, this allows you to compare item stacks based on their item type:
this_entity.getHandSlots[0].getItem == Registry('item').access.chest- For item and block registries there is a shortcut:
Item,Block.
this_entity.getHandSlots[0].getItem == Item('chest')BiomeandDimensionTypeare available dynamic registry shortcuts.
Dev Changes:
There's a handful new experimental APIs, which allow you to extend the expression system.
- Exposed
Object getValue()andResult convert(Object o)in Expression.Result. - Exposed
Expression eval(LootContext context, Map<String, Object> parameters)in Expression. - Exposed
ProxyMap,ObjectConverterandCustomDataAccessor(which is now a valid data type). - Exposed
CustomFields. One of the more interesting APIs. Allows adding new 'virtual' fields to reflective expression objects.static { CustomFields.addVirtualField(Entity.class, "nbt", NbtPredicate::entityToNbt); }
Other Changes:
- Switched to a custom fork of EvalEx.
- Switched to 16-digit precision from the EvalEx's standard of 68-digit.

