Carpet

Carpet

2M Downloads

[Feature Request][Scarpet] Allow scarpet custom commands to use `_` in argument names.

Crec0 opened this issue ยท 0 comments

commented

As of right now the _ in custom command types is only works for already defined types in scarpet. So using underscore in custom type will not work as expected.

Code

__config()->{
    'stay_loaded' -> true,
    'scope' -> 'global',    
    'commands' -> {
        'block <block_category>' -> _(c) -> print(c),
        'item <item_category>' -> _(c) -> print(c),
        'entity <entity_category>' -> _(c) -> print(c)
    },
    'arguments' -> {
        'block_category' -> {'type' -> 'term', 'options' -> ['mined']},
        'item_category' -> {'type' -> 'term', 'options' -> ['crafted', 'used', 'broken', 'picked_up', 'dropped']},
        'entity_category' -> {'type' -> 'term', 'options' -> ['killed', 'killed_by']},
    }
};

Expected behavior
image

Current behavior
image