From c92eea02e46f58ff2a6bd1a35c24b25b0e82ad4c Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 6 Jun 2020 17:39:00 -0700 Subject: [PATCH] Added respawn commands https://github.com/BentoBoxWorld/BentoBox/pull/1374 --- .../world/bentobox/bskyblock/Settings.java | 35 +++++++++++++++- src/main/resources/config.yml | 41 +++++++++++++------ 2 files changed, 62 insertions(+), 14 deletions(-) diff --git a/src/main/java/world/bentobox/bskyblock/Settings.java b/src/main/java/world/bentobox/bskyblock/Settings.java index ec37341..0b67cc7 100644 --- a/src/main/java/world/bentobox/bskyblock/Settings.java +++ b/src/main/java/world/bentobox/bskyblock/Settings.java @@ -411,6 +411,22 @@ public class Settings implements WorldSettings { @ConfigEntry(path = "island.commands.on-leave", since = "1.8.0") private List onLeaveCommands = new ArrayList<>(); + + @ConfigComment("List of commands to run when a player respawns on their island after death.") + @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 = "island.commands.on-respawn", since = "1.14.0") + private List onRespawnCommands = new ArrayList<>(); + // Sethome @ConfigEntry(path = "island.sethome.nether.allow") private boolean allowSetHomeInNether = true; @@ -453,7 +469,7 @@ public class Settings implements WorldSettings { @ConfigComment("List of mobs that should not spawn in BSkyBlock.") @ConfigEntry(path = "protection.block-mobs", since = "1.13.1") private List mobLimitSettings = new ArrayList<>(); - + // Invincible visitor settings @ConfigComment("Invincible visitors. List of damages that will not affect visitors.") @ConfigComment("Make list blank if visitors should receive all damages") @@ -1613,7 +1629,7 @@ public class Settings implements WorldSettings { public void setMaxTrustSize(int maxTrustSize) { this.maxTrustSize = maxTrustSize; } - + /** * @return the defaultNewPlayerAction */ @@ -1658,4 +1674,19 @@ public class Settings implements WorldSettings { public void setMobLimitSettings(List mobLimitSettings) { this.mobLimitSettings = mobLimitSettings; } + + /** + * @return the onRespawnCommands + */ + @Override + public List getOnRespawnCommands() { + return onRespawnCommands; + } + + /** + * @param onRespawnCommands the onRespawnCommands to set + */ + public void setOnRespawnCommands(List onRespawnCommands) { + this.onRespawnCommands = onRespawnCommands; + } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 5ebf05b..3bf6eb1 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -121,10 +121,10 @@ world: dragon-spawn: false # Mob white list - these mobs will NOT be removed when logging in or doing /island remove-mobs-whitelist: - - ZOMBIE_VILLAGER - - ENDERMAN - - PIG_ZOMBIE - WITHER + - ENDERMAN + - ZOMBIE_VILLAGER + - PIG_ZOMBIE # World flags. These are boolean settings for various flags for this world flags: CREEPER_DAMAGE: true @@ -139,8 +139,10 @@ world: NATURAL_SPAWNING_OUTSIDE_RANGE: true ENTER_EXIT_MESSAGES: true ENDERMAN_DEATH_DROP: true + LIQUIDS_FLOWING_OUT: false OFFLINE_REDSTONE: true REMOVE_END_EXIT_ISLAND: true + OFFLINE_GROWTH: true REMOVE_MOBS: true ENDER_CHEST: false ITEM_FRAME_DAMAGE: false @@ -167,44 +169,44 @@ world: END_PORTAL: 500 BREEDING: 500 HURT_VILLAGERS: 500 - TURTLE_EGGS: 500 FROST_WALKER: 500 + TURTLE_EGGS: 500 COLLECT_LAVA: 500 LEVER: 500 - RIDING: 500 HURT_MONSTERS: 0 - ARMOR_STAND: 500 + RIDING: 500 NAME_TAG: 500 + ARMOR_STAND: 500 TRADING: 0 EGGS: 500 ITEM_DROP: 0 NOTE_BLOCK: 0 NETHER_PORTAL: 500 - CROP_TRAMPLE: 500 ITEM_PICKUP: 0 - BREWING: 500 + CROP_TRAMPLE: 500 DROPPER: 500 + BREWING: 500 COLLECT_WATER: 500 BUTTON: 500 FIRE_EXTINGUISH: 500 BEACON: 500 TRAPDOOR: 500 PRESSURE_PLATE: 0 - ITEM_FRAME: 500 PLACE_BLOCKS: 500 + ITEM_FRAME: 500 CRAFTING: 0 SHEARING: 500 ENCHANTING: 0 - SPAWN_EGGS: 500 BED: 500 + SPAWN_EGGS: 500 MILKING: 0 DISPENSER: 500 GATE: 0 EXPERIENCE_PICKUP: 500 HOPPER: 500 LEASH: 500 - MOUNT_INVENTORY: 500 BREAK_BLOCKS: 500 + MOUNT_INVENTORY: 500 CHORUS_FRUIT: 500 CONTAINER: 500 POTION_THROWING: 500 @@ -234,7 +236,7 @@ world: island: # Default max team size # Permission size cannot be less than the default below. - max-team-size: 4 + max-team-size: 2 # Default maximum number of coop rank members per island # Players can have the bskyblock.coop.maxsize. permission to be bigger but # permission size cannot be less than the default below. @@ -376,6 +378,20 @@ island: # Note that player-executed commands might not work, as these commands can be run with said player being offline. # Added since 1.8.0. on-leave: [] + # List of commands to run when a player respawns on their island after death. + # 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: true @@ -434,3 +450,4 @@ protection: do-not-edit-these-settings: # These settings should not be edited reset-epoch: 0 +