Action Commands - No-Not-Jaden/NotBounties GitHub Wiki
Action commands are a useful tool to do way more than just a static command. Action commands can be used in bounty claim commands, GUI custom item commands, and big bounty commands.
-
{player}
is replaced with the name of the player whose bounty was claimed and died -
{killer}
is replaced with the name of the player who claimed the bounty Bounty Claim Only -
{amount}
is replaced with the value of the player's bounty (if applicable) -
{bounty}
is replaced with the formatted value of the player's bounty (if applicable) -
{cost}
is replaced with the currency prefix, formatted bounty value, and currency suffix (if applicable) -
{time}
is replaced by the current local time of the machine -
{c_prefix}
is replaced by the currency prefix -
{c_suffix}
is replaced by the currency suffix -
{balance}
is replaced by the player's balance -
{page}
is replaced with the GUI page GUI Only -
{slot<x>}
is replaced with the name of the owner of the skill in that slot, or if there is no skull, it will be replaced with the item's name GUI Only -
{player<x>}
is replaced with the name of the player in the GUI. If there are 3 players in the GUI, {player2} will be the second player in the GUI (with respect to how player-slots are ordered) GUI Only - PlaceholderAPI placeholders will be parsed if the plugin is enabled
Starting the command with...
- [player] or [p] will run the command as the player whose bounty was claimed
- [killer] will run the command as the player who claimed the bounty Bounty Claim Only
- neither will run the command from the console Some special actions can occur as opposed to a command. To play a sound, use...
-
[sound_player] (SOUND_ID) <VOLUME> <PITCH>
to play a sound for the player -
[sound_killer] (SOUND_ID) <VOLUME> <PITCH>
to play a sound for the killer Bounty Claim Only -
[sound] (SOUND_ID) <VOLUME> <PITCH>
to play a sound for everyone near the death Sound IDs can be found on this webpage. Volume and pitch should stay at 1 for most cases. Another special action is<respawn>
. Using this will respawn the player automatically.
bounty-claim-commands:
# this is the same as the command `execute at {killer} run minecraft:playsound minecraft:entity.ender_eye.death master @a ~ ~ ~ 1 1'
- '[sound] ENTITY_ENDER_EYE_DEATH 1 1'
# this will respawn the player
- '<respawn>'
# this will open the bounty GUI for the player
- '[player] bounty'
Messages can be sent through action commands too.
- [message_player] sends a message to the player using the NotBounties prefix
- [message_killer] sends a message to the killer using the NotBounties prefix Bounty Claim Only
- [broadcast] sends a message to everyone using the NotBounties prefix besides the people with bounty broadcast disabled
To open a GUI, use [gui] (gui name) (page) (leaderboard/offline)
. Only the GUI name is required Here are a few examples:
-
[gui] bounty-gui
opens the bounty-gui GUI -
[gui] leaderboard 1 kills
opens the leaderboard GUI at page 1 for the kills leaderboard -
[gui] set-bounty 1 offline
opens the set-bounty GUI at page 1 including the offline players
Commands can also be run after accepting input from a player with prompts
-
[pprompt] (command) <what value>
player executes the completed command -
[cprompt] (command) <what value>
console executes the completed command
# prompt example
commands:
- '[pprompt] bounty {slot13} <&eEnter in chat the bounty amount or type "cancel" to cancel.>'
If you are using a command that isn't from NotBounties, then it may be useful to specify the response type in your prompt. The two different response types are NUMBER
and PLAYER
.
[pprompt] (command) <NUMBER~what number>
[pprompt] (command) <PLAYER~what player>
# prompt example for other commands
commands:
- '[cprompt] give <PLAYER~&eEnter in chat a player name or type "cancel" to cancel.> DIAMOND 1'
Prompt attempts, cancel words, and time limit can be edited with the prompts
configuration section in the config.yml file.
# prompt feature settings for action commands
prompts:
# how many attempts the player gets before the prompt is canceled
attempts: 5
# typing these words in chat will exit the prompt
cancel-words:
- 'cancel'
- 'exit'
# the time the player has to type in an answer to the prompt before it times out
# in seconds
time-limit: 30
Here are a few GUI specific actions GUI Only
-
[close]
Closes the GUI -
[next] <amount>
Moves to the next page with an optional amount of pages to move -
[back] <amount>
Moves to the previous page with an optional amount of pages to move -
[offline]
Toggles including offline players in the GUI
Commands can check a couple of conditional values before executing. You can use none, one, or multiple in the same line.
-
Bounty Amount - Starting a command with
>(amount)
or<(amount)
will check if the claimed bounty is greater than or less than the value before executing. -
Permission Nodes - Starting a command with
@(player/killer)permission
or!@(player/killer)permission
will check if the player or killer has or doesn't have a permission node before executing.@permission
and!@permission
work too for just the player. -
Placeholders - (Must have PlaceholderAPI) Starting a command with
~player(%placeholder% operator value)
or~killer(%placeholder% operator value)
will compare a placeholder with a value before running the command.%placeholder%
is the placeholder from PlaceholderAPI that you want to use.value
is the value that you are comparing with the placeholder.operator
compares the placeholder and value. (!=,=,>=,<=,>,<). Examples include%nottokens_tokens% != 0
and%Advancements_nether/return_to_sender% = true
# bounty claim commands example
bounty-claim-commands:
# This tempbans the player if they had a bounty claimed greater than or equal to 2500 currency
- '>(2499.99) tempban {player} 1h'
# This will check if the killer has the permission node notbounties.view and will message the person they killed
- '@(killer)notbounties.view [killer] msg {player} It wasn't personal.'
# This will auto-respawn the player if the bounty is between 10 and 100, and they have the permission node plugin.quick-respawn
- '>(10) <(100) @(player)plugin.quick-respawn <respawn>'
# GUI custom item example
commands:
- '[email protected] [p] bounty buy --confirm' # only run by players
- '@notbounties.admin [p] bounty remove {slot13}' # only run by admins
- '[close]' # run by everyone