Skip to content

Item Slots

Returns an int of a specific slot in any type of inventory . You can use ItemSlotArgument for the selection of one slot, and ItemSlotsArgument for multiple slots. Examples:

Java
new StellarCommand("clear-item")
    .addItemSlotArgument("slot")
    .addExecution(Player.class, context -> {
        int slot = (int) context.getArgument("slot")
        context.getSendern().getInventory().setItem(slot, null)
    });
Java
new StellarCommand("cleari-tems")
    .addItemSlotArgument("slots", multiple = true)
    .addExecution(Player.class, context -> {
        int slots = getArgument<List<Integer>>("slots")
        for (slot in slots) context.getSendern().getInventory().setItem(slot, null)
    });
Argument Parser

Item Slot Argument

Released under the MIT License.