Skip to content

Click Options

The click_options field defines what happens when a player clicks on an entry in the shop. This is a map of Click Type to the Click Action that should be executed when that click type is done. This is useful as it allows you to change the behavior of your shop to your liking.

For example, you can have a shop where left-clicking an item opens a Confirm Menu to buy the item, while right-clicking the item opens a different Confirm Menu to sell the item. Or instead, you could configure direct purchasing and selling without a confirmation menu!

"click_options": {
"ANY_LEFT_CLICK": {
"type": "OPEN_CONFIRM_MENU",
"sound": {
"id": "minecraft:ui.button.click",
"source": "MASTER",
"volume": 0.5,
"pitch": 0.5
},
"transactions": [
"buy"
],
"menu": "example_buy"
},
"ANY_RIGHT_CLICK": {
"type": "OPEN_CONFIRM_MENU",
"sound": {
"id": "minecraft:ui.button.click",
"source": "MASTER",
"volume": 0.5,
"pitch": 0.5
},
"transactions": [
"sell"
],
"menu": "example_sell"
}
}

The type of action that should be executed when the specified click type is done. A list of valid actions can be found in Click Actions.

"type": "OPEN_CONFIRM_MENU"

The sound that should be played when the specified click type is done. This is optional and defaults to no sound if not specified.

"sound": {
"id": "minecraft:ui.button.click",
"source": "MASTER",
"volume": 0.5,
"pitch": 0.5
}

Click Actions are similar to regular Actions, but they are specific to Shop Entry clicking.

IdentifierDescription
OPEN_CONFIRM_MENUOpens a confirmation menu for the player to confirm their purchase/sell.
BUYDirectly buy the entry without a confirmation menu.
SELLDirectly sell the entry without a confirmation menu.

Opens a Confirm Menu for the player to confirm their purchase/sell.

"ANY_CLICK": {
"type": "OPEN_CONFIRM_MENU",
"sound": {
"id": "minecraft:ui.button.click",
"source": "MASTER",
"volume": 0.5,
"pitch": 0.5
},
"transactions": [
"buy"
],
"menu": "example_buy"
}

The transactions that should be executed when the player confirms their purchase/sell in the Confirm Menu. This is a list of the transaction types that should be executed, which can be buy, sell, or both.

"transactions": [
"buy",
"sell"
]

The Confirm Menu that should be opened when the player clicks on the entry. This should be the string identifier of a Confirm Menu defined in the confirm_menus section of the config.

"menu": "example_confirm_menu"




Directly buy the entry without a confirmation menu.

"ANY_CLICK": {
"type": "BUY",
"sound": {
"id": "minecraft:entity.player.levelup",
"source": "MASTER",
"volume": 0.5,
"pitch": 0.5
},
"amount": 1
}

The amount of the entry that should be bought when the player clicks on the entry. This is required and should be a positive integer.

"amount": 1




Directly sell the entry without a confirmation menu.

"ANY_CLICK": {
"type": "SELL",
"sound": {
"id": "minecraft:entity.player.levelup",
"source": "MASTER",
"volume": 0.5,
"pitch": 0.5
},
"amount": 1
}

The amount of the entry that should be sold when the player clicks on the entry. This is required and should be a positive integer.

"amount": 1

Below is a list of valid click types that can be used in the click_type option for Actions.

IdentifierLeft ClickShift Left ClickRight ClickShift Right ClickMiddle ClickThrow (Q)
ANY
LEFT_CLICK
SHIFT_LEFT_CLICK
ANY_LEFT_CLICK
RIGHT_CLICK
SHIFT_RIGHT_CLICK
ANY_RIGHT_CLICK
ANY_CLICK
ANY_MAIN_CLICK
ANY_SHIFT_CLICK
MIDDLE_CLICK
THROW