Commander has been archived. Commander will not receive any further updates unless the author decides to unarchive the project.
Compatibility
Minecraft: Java Edition
1.21.x
1.20.4
1.20.1
Platforms
Fabric
Supported environments
90% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Details
Changelog
What's New:
User Changes:
- Added
arrayFindAny
andarrayFindFirst
functions to expressions. As the name suggests, those functions will try to find an element of an array or returnnull
if the array is empty. - Added
chain
function 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
remove
tocmd:data
. - Added
cmd:operate
to thescoreboard players
command. - Added registry access for expressions! Now you can access the game's static and dynamic content registries by using new
Registry
andDynamicRegistry
functions.- 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')
Biome
andDimensionType
are 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
,ObjectConverter
andCustomDataAccessor
(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.
Files
Metadata
Release channel
BetaVersion number
0.7.0-1.20.1-build.17Loaders
Game versions
1.20.1Downloads
217Publication date
July 25, 2024 at 3:51 PMPublisher
melontini
Author