The script slot menu can be used to create script slots. Script slots will fire events when they are clicked. If you use the Skript or Denizen plug-in, you can listen for these events. Alternatively, you can write your own minecraft plug-in that can listen for it. Scripting slots are useless for you if you can't write scripts or plug-ins. This menu should look like this:

Properties

Action ID

The Action ID distinguishes this event/action from other events. You should typically give every script slot a distinct Action ID. When you use Skript or Denizen, the Action ID also determines how you should listen for this action/event.

Display

The Display determines what the slot looks like. For instance, you could create a custom item with a 'button texture' and display that.

Skript usage

Listening

To listen for the event, use on kci container action "ActionID":
The double quotes are required and you should replace ActionID with the right action ID.

Expressions

Effects

Denizen usage

Listening

To listen for the event, use on kci container action action_id:, where action_id is the Action ID of this slot.

Context properties

Context determinations

Note: the action IDs and slot names of custom containers are case sensitive, but Denizen seems to automatically convert your determinations to lowercase (probably because Denizen scripts are not meant to be case sensitive). If you would like to manipulate your container slots via Denizen, I recommend using only lowercase characters for your action IDs and slot names.

Java usage

Listening

To listen for the Bukkit/Java event, you need to create a plug-in that listens for the nl.knokko.customitems.plugin.events.CustomContainerActionEvent event. To import this, you will need to add CustomItems.jar to your classpath.

Properties

  • actionID: The Action ID of the clicked action slot. If you have multiple action slots, you should compare this with the Action ID of the slot you are interested it.
  • container: The ContainerInstance of the custom container whose slot was clicked. You can call its methods to query and/or modify the state of the custom container. You can use your tab completions to discover the possibilities.
  • clickEvent: The InventoryClickEvent that caused this event. You can use this event to query the cursor item or the click type.
  • itemSet: The ItemSetWrapper of your item set. You can use this to query your own item set. Also check out its get() method, which you can use to query even more data.