warieregg

I want to optimize my Minecraft server by completely disabling the natural spawning of Skeletons, Creepers, and Zombies across the entire server. These three hostile mobs should never spawn anywhere, while all other mobs should continue spawning normally.

The main goal is to reduce server lag, improve TPS, and boost overall server performance without affecting the spawning of other mobs. The solution should be efficient, lightweight, and compatible with the server to ensure smooth gameplay.

Kodari AI
KodariJun 27 at 2:37 pm 9

I’ll create a lightweight performance optimization plugin that prevents those three specific hostile mobs from spawning naturally.

MobSpawnOptimizer
A lightweight performance optimization plugin that prevents Skeletons, Creepers, and Zombies from spawning naturally across the server. Reduces server lag and improves TPS by blocking natural spawns of these three hostile mobs while allowing all other entities to spawn normally. Features efficient event handling with minimal overhead for maximum performance gains.

Plugin created. This is an extremely lightweight solution that:

  • Blocks only natural spawns of Skeletons, Creepers, and Zombies

  • Preserves spawners, spawn eggs, and commands - other spawn methods still work

  • Uses HIGHEST priority to respect other protection plugins

  • Early returns for non-natural spawns to minimize CPU usage

  • Zero configuration overhead - just drop in and it works

The performance impact is negligible since the event handler does minimal checks and returns immediately for irrelevant spawns.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
4 73
src/main/java/com/example/mobspawnoptimizer/MobSpawnOptimizer.java
package com.example.mobspawnoptimizer;

import com.example.mobspawnoptimizer.listeners.SpawnListener;
import org.bukkit.plugin.java.JavaPlugin;

public class MobSpawnOptimizer extends JavaPlugin {
    
    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new SpawnListener(), this);
        getLogger().info("MobSpawnOptimizer enabled - Natural spawning disabled for Skeletons, Creepers, and Zombies");
    }
    
    @Override
    public void onDisable() {
        getLogger().info("MobSpawnOptimizer disabled");
    }
}