diff --git a/paper-api/src/main/java/org/bukkit/Bukkit.java b/paper-api/src/main/java/org/bukkit/Bukkit.java index f43b0f0d58..a24678685c 100644 --- a/paper-api/src/main/java/org/bukkit/Bukkit.java +++ b/paper-api/src/main/java/org/bukkit/Bukkit.java @@ -353,6 +353,50 @@ public final class Bukkit { return server.getTicksPerMonsterSpawns(); } + /** + * Gets the default ticks per water mob spawns value. + *

+ * Example Usage: + *

+ *

+ * Note: If set to 0, water mobs spawning will be disabled. + *

+ * Minecraft default: 1. + * + * @return the default ticks per water mobs spawn value + */ + public static int getTicksPerWaterSpawns() { + return server.getTicksPerWaterSpawns(); + } + + /** + * Gets the default ticks per ambient mob spawns value. + *

+ * Example Usage: + *

+ *

+ * Note: If set to 0, ambient mobs spawning will be disabled. + *

+ * Minecraft default: 1. + * + * @return the default ticks per ambient mobs spawn value + */ + public static int getTicksPerAmbientSpawns() { + return server.getTicksPerAmbientSpawns(); + } + /** * Gets a player object by the given username. *

diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index 4990606659..266f5cb8cd 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -294,6 +294,46 @@ public interface Server extends PluginMessageRecipient { */ public int getTicksPerMonsterSpawns(); + /** + * Gets the default ticks per water mob spawns value. + *

+ * Example Usage: + *

+ *

+ * Note: If set to 0, water mobs spawning will be disabled. + *

+ * Minecraft default: 1. + * + * @return the default ticks per water mobs spawn value + */ + public int getTicksPerWaterSpawns(); + + /** + * Gets the default ticks per ambient mob spawns value. + *

+ * Example Usage: + *

+ *

+ * Note: If set to 0, ambient mobs spawning will be disabled. + *

+ * Minecraft default: 1. + * + * @return the default ticks per ambient mobs spawn value + */ + public int getTicksPerAmbientSpawns(); + /** * Gets a player object by the given username. *

diff --git a/paper-api/src/main/java/org/bukkit/World.java b/paper-api/src/main/java/org/bukkit/World.java index f9246bd219..983b675573 100644 --- a/paper-api/src/main/java/org/bukkit/World.java +++ b/paper-api/src/main/java/org/bukkit/World.java @@ -1636,6 +1636,104 @@ public interface World extends PluginMessageRecipient, Metadatable { */ public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns); + /** + * Gets the world's ticks per water mob spawns value + *

+ * This value determines how many ticks there are between attempts to + * spawn water mobs. + *

+ * Example Usage: + *

+ *

+ * Note: + * If set to 0, water mobs spawning will be disabled for this world. + *

+ * Minecraft default: 1. + * + * @return The world's ticks per water mob spawns value + */ + public long getTicksPerWaterSpawns(); + + /** + * Sets the world's ticks per water mob spawns value + *

+ * This value determines how many ticks there are between attempts to + * spawn water mobs. + *

+ * Example Usage: + *

+ *

+ * Note: + * If set to 0, water mobs spawning will be disabled for this world. + *

+ * Minecraft default: 1. + * + * @param ticksPerWaterSpawns the ticks per water mob spawns value you + * want to set the world to + */ + public void setTicksPerWaterSpawns(int ticksPerWaterSpawns); + + /** + * Gets the world's ticks per ambient mob spawns value + *

+ * This value determines how many ticks there are between attempts to + * spawn ambient mobs. + *

+ * Example Usage: + *

+ *

+ * Note: + * If set to 0, ambient mobs spawning will be disabled for this world. + *

+ * Minecraft default: 1. + * + * @return The world's ticks per ambient mob spawns value + */ + public long getTicksPerAmbientSpawns(); + + /** + * Sets the world's ticks per ambient mob spawns value + *

+ * This value determines how many ticks there are between attempts to + * spawn ambient mobs. + *

+ * Example Usage: + *

+ *

+ * Note: + * If set to 0, ambient mobs spawning will be disabled for this world. + *

+ * Minecraft default: 1. + * + * @param ticksPerAmbientSpawns the ticks per ambient mob spawns value you + * want to set the world to + */ + public void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns); + /** * Gets limit for number of monsters that can spawn in a chunk in this * world