Skip to content

Commit

Permalink
Expose BentoBox 1.14 onRespawnCommands (#14)
Browse files Browse the repository at this point in the history
* Expose BentoBox 1.14 onRespawnCommands
BentoBoxWorld/BentoBox#1719

* Update Settings.java
  • Loading branch information
BONNe committed Mar 16, 2021
1 parent 9f4ac86 commit 8971755
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/main/java/world/bentobox/boxed/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,21 @@ public class Settings implements WorldSettings {
@ConfigEntry(path = "area.commands.on-leave")
private List<String> onLeaveCommands = new ArrayList<>();

@ConfigComment("List of commands that should be executed when the player respawns after death if Flags.ISLAND_RESPAWN is true.")
@ConfigComment("These commands are run by the console, unless otherwise stated using the [SUDO] prefix,")
@ConfigComment("in which case they are executed by the player.")
@ConfigComment("")
@ConfigComment("Available placeholders for the commands are the following:")
@ConfigComment(" * [name]: name of the player")
@ConfigComment("")
@ConfigComment("Here are some examples of valid commands to execute:")
@ConfigComment(" * '[SUDO] bbox version'")
@ConfigComment(" * 'bsbadmin deaths set [player] 0'")
@ConfigComment("")
@ConfigComment("Note that player-executed commands might not work, as these commands can be run with said player being offline.")
@ConfigEntry(path = "area.commands.on-respawn", since = "1.14.0")
private List<String> onRespawnCommands = new ArrayList<>();

// Sethome
@ConfigComment("Allow setting home in the nether. Only available on nether areas, not vanilla nether.")
@ConfigEntry(path = "area.sethome.nether.allow")
Expand Down Expand Up @@ -1326,6 +1341,23 @@ public void setOnLeaveCommands(List<String> onLeaveCommands) {
this.onLeaveCommands = onLeaveCommands;
}

/**
* @return the onRespawnCommands
*/
@Override
public List<String> getOnRespawnCommands() {
return onRespawnCommands;
}

/**
* Sets on respawn commands.
*
* @param onRespawnCommands the on respawn commands
*/
public void setOnRespawnCommands(List<String> onRespawnCommands) {
this.onRespawnCommands = onRespawnCommands;
}

/**
* @return the onJoinResetHealth
*/
Expand Down
14 changes: 14 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,20 @@ area:
#
# Note that player-executed commands might not work, as these commands can be run with said player being offline.
on-leave: []
# Returns a list of commands that should be executed when the player respawns after death if Flags.ISLAND_RESPAWN is true.
# These commands are run by the console, unless otherwise stated using the [SUDO] prefix,
# in which case they are executed by the player.
#
# Available placeholders for the commands are the following:
# * [name]: name of the player
#
# Here are some examples of valid commands to execute:
# * '[SUDO] bbox version'
# * 'bsbadmin deaths set [player] 0'
#
# Note that player-executed commands might not work, as these commands can be run with said player being offline.
# Added since 1.14.0.
on-respawn: []
sethome:
nether:
# Allow setting home in the nether. Only available on nether areas, not vanilla nether.
Expand Down

0 comments on commit 8971755

Please sign in to comment.