BG-Software
Search…
Island Settings
Every island has settings (flags) that their island owners can modify. They are used to control different things on the island: fluid flow, lava, spawning and more!

Built-in Settings

Always Day Toggles time to always be day inside the island. This settings cannot work with other settings that change time.
Always Middle Day Toggles time to always be the middle of the day inside the island. This settings cannot work with other settings that change time.
Always Night Toggles time to always be night inside the island. This settings cannot work with other settings that change time.
Always Middle Night Toggles time to always be the middle of the night inside the island. This settings cannot work with other settings that change time.
Always Rain Toggles weather to always be rainy inside the island. This settings cannot work with other settings that change weather.
Always Shiny Toggles weather to always be shiny inside the island. This settings cannot work with other settings that change weather.
Creeper Explosion Toggles creeper explosions harming blocks inside the island.
Crops Growth Toggles growth of crops inside the island.
Egg Lay Toggles chickens laying eggs inside the island.
Enderman Grief Toggles endermans picking up blocks inside the island.
Fire Spread Toggles fire spread to other blocks inside the island.
Ghast Fireball Toggles fireballs harming blocks inside the island.
Lava Flow Toggles lava flowing inside the island.
Natural Animals Spawn Toggles natural spawning of animals inside the island.
Natural Monster Spawn Toggles natural spawning of monsters inside the island.
PvP Toggles pvp between players inside the island. When enabling the settings, all visitors will be teleported to spawn to prevent traps.
Spawner Animals Spawn Toggles spawner spawning animals inside the island.
Spawner Monster Spawn Toggles spawner spawning monsters inside the island.
TNT Explosion Toggles tnt explosions harming blocks inside the island.
Tree Growth Toggles growth of trees inside the island.
Water Flow Toggles water flowing inside the island.
Wither Explosion Toggles wither explosions harming blocks inside the island.

Create your own setting

In order to create your own setting, you must have knowledge in Java and the Spigot API. Alongside of these, you'll also need the SuperiorSkyblock's API, which can be found here.
Island settings are represented as a class called "IslandFlag", and it's really easy to register custom ones! In this tutorial, I will make a custom setting for swimming. First, I register the custom setting by listening to the PluginInitializeEvent, and there I am calling the IslandFlag.register() method.
1
public final class SwimmingFlag implements Listener {
2
3
private static IslandFlag SWIMMING;
4
5
@EventHandler
6
public void onPluginInit(PluginInitializeEvent e){
7
IslandFlag.register("SWIMMING");
8
SWIMMING = IslandFlag.getByName("SWIMMING");
9
}
10
11
}
Copied!
PluginInitializeEvent is called in the onEnable() method of SuperiorSkyblock. Therefore, you must have your plugin enabling before SuperiorSkyblock, which can be done by adding "SuperiorSkyblock2" as a depend/softdepend plugin.
After registering the custom flag, we can simply implement the restriction for swimming!
1
public final class SwimmingFlag implements Listener {
2
3
private static IslandFlag SWIMMING;
4
5
@EventHandler
6
public void onPluginInit(PluginInitializeEvent e){
7
IslandFlag.register("SWIMMING");
8
SWIMMING = IslandFlag.getByName("SWIMMING");
9
}
10
11
@EventHandler(ignoreCancelled = true)
12
public void onPlayerMove(PlayerMoveEvent e){
13
// First I check for movement between blocks
14
if(e.getFrom().getBlockX() == e.getTo().getBlockX() && e.getFrom().getBlockY() == e.getTo().getBlockY() &&
15
e.getFrom().getBlockZ() == e.getTo().getBlockZ())
16
return;
17
18
Island island = SuperiorSkyblockAPI.getIslandAt(e.getTo());
19
20
// We make sure that swimming is disabled
21
if(island == null || island.hasSettingsEnabled(SWIMMING))
22
return;
23
24
Block toBlock = e.getTo().getBlock();
25
Block belowBlock = toBlock.getRelative(BlockFace.DOWN);
26
27
// We check if the target block is water, or the block below it is water.
28
if(toBlock.getType() == Material.WATER || (!toBlock.getType().isSolid() && belowBlock.getType() == Material.WATER)){
29
e.setCancelled(true);
30
e.getPlayer().sendMessage("" + ChatColor.RED + ChatColor.BOLD + "Error | " + ChatColor.GRAY + "This island has swimming disabled.");
31
}
32
33
}
34
35
}
Copied!
That's it! Now players cannot enter water if the setting is disabled. You can simply add the new setting to the settings menu, and edit it's display icon there, the same as the regular settings.
Last modified 1mo ago