Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Get Modrinth App Upgrade to Modrinth+
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
Commander

Commander

An extension of the data pack system.

43.4k
13
Library
Utility

Compatibility

Minecraft: Java Edition

1.21.x
1.20.4
1.20.1

Platforms

Fabric

Supported environments

Server-side

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Links

Report issues View source Visit wiki

Creators

constellation
constellationOrganization

melontini
melontini Author

Details

Licensed MIT
Published last year
Updated 11 months ago
DescriptionGalleryChangelogVersions
All versions0.7.0 (1.20.1)

0.7.0 (1.20.1)

Download
Report

Changelog

What's New:

User Changes:

  • Added arrayFindAny and arrayFindFirst functions to expressions. As the name suggests, those functions will try to find an element of an array or return null 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 to cmd:data.
  • Added cmd:operate to the scoreboard players command.
  • Added registry access for expressions! Now you can access the game's static and dynamic content registries by using new Registry and DynamicRegistry 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 and DimensionType 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() and Result convert(Object o) in Expression.Result.
  • Exposed Expression eval(LootContext context, Map<String, Object> parameters) in Expression.
  • Exposed ProxyMap, ObjectConverter and CustomDataAccessor (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.

Dependencies

dependency-iconFabric APIrequired
dependency-iconDark Matterembedded

Files

commander-0.7.0-1.20.1-build.17.jar(878.95 KiB) Primary
Download
commander-0.7.0-1.20.1-build.17-sources.jar(96.23 KiB)
Download

Metadata

Release channel

Beta

Version number

0.7.0-1.20.1-build.17

Loaders

Fabric

Game versions

1.20.1

Downloads

247

Publication date

July 25, 2024 at 3:51 PM

Publisher

melontini

melontini

Author

Version ID

Modrinth is open source.

main@396f737

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.