Actions v2 - RealMegaMinds/ActionInventoryMod GitHub Wiki
Actions determine what actually happens when an action item is clicked.
Actions are represented by a json object. All actions have:
key = 'type'
Can be one of 'command', 'give', 'open', 'sound', 'allmessage', 'multimessage', 'playermessage', 'servermessage', and 'singlemessage'.
Depending on the type, there are additional requirements. Note: references to "player" means the player that clicked the action item.
This executes a command.
An action with type 'command' must have:
key = 'command'
This is a string. This is the command to execute.key = 'fromServer'
This is a boolean. This determines whether the command is executed by the server (true) or by the player (false).key = 'makeTempOp'
This is a boolean. This determines whether the player should be temporarily given op to execute the command (true) or if the command should throw an error if the player is not an op and the command requires it (false). If true, when the command is finished the player will be deopped (if they weren't previously opped).
This gives the player items.
An action with type 'give' must have:
key = 'itemStack'
This is an object. This is the item stack to give the player. Contains:key = 'item'
This is a string. This is the identifier of this item stack's item.key = 'count'
This is an int. This is the number of items this item stack has.key = 'nbt'
This is a string. This is the item stack's custom nbt in snbt format.
This opens an action inventory for the player.
An action with type 'open' must have:
key = 'name'
This is a string. This is the name of the action inventory to open.
This makes a sound when clicked.
An action with type 'sound' must have:
key = 'sound'
This is a string. This is the identifier for the sound to play.key = 'pitch'
This is a float. This is the pitch of the sound.key = 'volume'
This is a float. This is the volume of the sound.
This broadcasts a message to all players.
An action with type 'allMessage' must have:
key = 'msg'
This is an object. This is the message to send.key = 'fromServer'
This is a boolean. This determines whether the message should be sent from the server (true) or from the player (false).
This sends a message to multiple players.
An action with type 'multiMessage' must have:
key = 'msg'
This is an object. This is the message to send.key = 'fromServer'
This is a boolean. This determines whether the message should be sent from the server (true) or from the player (false).key = 'to'
This is an array of strings. These are the uuids of the players to send the message to.
This sends a message to a single player.
An action with type 'singleMessage' must have:
key = 'msg'
This is an object. This is the message to send.key = 'fromServer'
This is a boolean. This determines whether the message should be sent from the server (true) or from the player (false).key = 'to'
This is a string. This is the uuid of the player to send the message to.
This sends a message to the player that clicked the action item.
An action with type 'playerMessage' must have:
key = 'msg'
This is an object. This is the message to send.key = 'fromServer'
This is a boolean. This determines whether the message should be sent from the server (true) or from the nil_uuid (false).
This sends a message to the server/logs a message.
An action with type 'serverMessage' must have:
key = 'msg'
This is an object. This is the message to send.key = 'fromPlayer'
This is a boolean. This determines whether the message should be sent from the player (true) or from the nil_uuid (false).