diff --git a/src/main/java/world/bentobox/caveblock/Settings.java b/src/main/java/world/bentobox/caveblock/Settings.java index c2ac988..0d4d553 100644 --- a/src/main/java/world/bentobox/caveblock/Settings.java +++ b/src/main/java/world/bentobox/caveblock/Settings.java @@ -1501,12 +1501,43 @@ public class Settings implements WorldSettings this.adminCommand = adminCommand; } + /** + * @return the onJoinCommands + */ + @Override + public List getOnJoinCommands() { + return onJoinCommands; + } + + + /** + * @param onJoinCommands the onJoinCommands to set + */ + public void setOnJoinCommands(List onJoinCommands) { + this.onJoinCommands = onJoinCommands; + } + + + /** + * @return the onLeaveCommands + */ + @Override + public List getOnLeaveCommands() { + return onLeaveCommands; + } + + + /** + * @param onLeaveCommands the onLeaveCommands to set + */ + public void setOnLeaveCommands(List onLeaveCommands) { + this.onLeaveCommands = onLeaveCommands; + } // --------------------------------------------------------------------- // Section: Variables // --------------------------------------------------------------------- - /* Commands */ @ConfigComment("Cave Command. What command users will run to access their cave.") @ConfigComment("To define alias, just separate commands with white space.") @@ -1803,6 +1834,15 @@ public class Settings implements WorldSettings @ConfigEntry(path = "island.reset.on-leave.ender-chest") private boolean onLeaveResetEnderChest = false; + // Commands + @ConfigComment("List of commands to run when a player joins.") + @ConfigEntry(path = "island.commands.on-join") + private List onJoinCommands = new ArrayList<>(); + + @ConfigComment("list of commands to run when a player leaves.") + @ConfigEntry(path = "island.commands.on-leave") + private List onLeaveCommands = new ArrayList<>(); + // Sethome @ConfigEntry(path = "island.sethome.nether.allow") private boolean allowSetHomeInNether = true; diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 441307e..3455261 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -315,6 +315,11 @@ island: inventory: false # Reset Ender Chest - if true, the player's Ender Chest will be cleared. ender-chest: false + commands: + # List of commands to run when a player joins. + on-join: [] + # List of commands to run when a player leaves. + on-leave: [] sethome: nether: allow: true