Skip to content

2.2 General Options

Yanbing Zhao edited this page Jun 20, 2019 · 2 revisions

TextTitle

The value of this option should be a string, which represents the title of a menu.

Formatting codes starting with & could also be used to set the colors or styles of the title. For example, &2 means dark green, &l means bold, etc.

TextTitle = "Example" // the normal title, whose font color is black
TextTitle = "&1&lExample" // the bold title, whose font color is dark blue

Please refer to the Minecraft Wiki for more details about the formatting codes.

Rows

The value of this option should be a positive integer, which means how many rows the menu should have.

In theory, any positive number is acceptable, but in fact, a number greater than 6 will affect the players' game experience.

Slot0, Slot1, etc.

The value of this option could be either a section or a list of sections. If it is a section, it will describe the items in a particular slot directly. If it is a list, the menu will choose the first section, the item described by which meets the requirements.

For more information about slot configuration and requirements, please refer to this page.

the number as the suffix of the option indicates the location of the slot as the picture shows:

TriggerItem

This value of this option should describe an item for opening the menu. For example:

TriggerItem {
    ItemType = "minecraft:compass"
}

The example says that if a player left clicks or right clicks a compass held in the hand, the corresponding menu will be opened.

You can also set the UnsafeDamage to tell the plugin that only if the item meta matches will the menu be opened like this:

// Both coal and charcoal can open the menu
TriggerItem {
    ItemType = "minecraft:coal"
}
// Only the coal can open it
TriggerItem {
    ItemType = "minecraft:coal"
    UnsafeDamage = 0
}
// Only the charcoal does
TriggerItem {
    ItemType = "minecraft:coal"
    UnsafeDamage = 1
}

You can also set the EnablePrimaryAction or EnableSecondaryAction option to false to tell the plugin if the player can open the menu by left clicking or right clicking the item:

// Only right clicking can the player open the menu
TriggerItem {
    ItemType = "minecraft:compass"
    EnablePrimaryAction = false
}
// Only left clicking does
TriggerItem {
    ItemType = "minecraft:compass"
    EnableSecondaryAction = false
}
// Neither left nor right clicking does, but why do you want to do this?
TriggerItem {
    ItemType = "minecraft:compass"
    EnableSecondaryAction = false
    EnablePrimaryAction = false
}

OpenCommand

This value of this option should describe an action which would be submitted at the moment of opening the chest GUI.

CloseCommand

This value of this option should describe an action which would be submitted at the moment of closing the chest GUI.

UpdateIntervalTick

This value of this option determines the update interval ticks between two updates. No updates will be performed if it set to 0 or it is not set.

AcceptableActionIntervalTick

This value of this option determines the minimal interval between two clicks. The player can click the menu all the time if it is set to 0 and the value of acceptable-action-interval-tick will be inherited if it is not set.