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–1.21.1
1.20.4
1.20.1
Platforms
Supported environments
Details
Changelog
What's New:
User Changes:
- Added
?.and?null safe operators.?.Used on structures. Same as., but returns null if there's no such field in structure.?Used with anything that can be null. Returns the right operand if left is null or left if not.
These operators allow you to quickly check for nulls in your expressions. Let's image a situation like this:
You have a variable struct.x which might not exist and maybe null. Before, you'd have to write something like this:
if(structContainsKey(struct, 'x') && struct.x != null, struct.x, valueElse())'
Now this can be shortened to: struct?.x ? valueElse(). Do note that ? has a very low precedence, so in ambiguous cases you'll have to wrap it in parentheses. e.g. 23 + struct?.x ? 23 -> 23 + (struct?.x ? 23).
- Java
Optionals are now unwrapped in expressions. - Minecraft
Identifiers are now converted to strings in expressions. - Gson elements can now be used in expressions.
Dev Changes:
- Fixed
equalson CustomDataAccessors. - Added
LootContextas an argument for theCustomFields#addVirtualFieldfunction.
Other Changes:
- Updated mEvalEx to fix expression inlining.
Files
Metadata
Release channel
BetaVersion number
0.8.0-1.20.4-build.21Loaders
Game versions
1.20.4Environment
Server-side only, works in singleplayer too
Downloads
133Publication date
July 27, 2024 at 9:42 PMPublisher
zenfyr
Author




