Templates & Code Snippets

Explore a collection of useful code snippets and templates for Minecraft server development, optimization, and more. Feel free to copy and adapt them for your projects!

Server Optimization Config (Paper.yml example)

Highly optimized Paper.yml settings to reduce lag and improve performance.

# Paper global configuration
settings:
  chunk-loading:
    max-concurrent-reads: 8
    min-load-time: 50
  tick-rates:
    no-tick-view-distance: 10
    enable-lag-limiter: true
    lag-limiter:
      high-water: 0.9
      low-water: 0.8
  entity-tracking-range:
    players: 48
    animals: 48
    monsters: 48
    misc: 32
    other: 64
  max-entity-collisions: 2

Basic Spigot Plugin (Java)

A minimal Spigot plugin structure printing a message when enabled.

package com.oshan.myplugin;

import org.bukkit.plugin.java.JavaPlugin;

public class MyAwesomePlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        getLogger().info("MyAwesomePlugin has been enabled!");
        getCommand("hello").setExecutor(new HelloCommand());
    }

    @Override
    public void onDisable() {
        getLogger().info("MyAwesomePlugin has been disabled!");
    }
}

BungeeCord Config (config.yml)

Example config.yml for BungeeCord to link multiple Minecraft servers.

listeners:
- host: 0.0.0.0:25577
  query_enabled: false
  force_default_server: true
  tab_list: GLOBAL_PING
  ping_passthrough: false
  motd: '&1Welcome to the BungeeCord Network!'
  max_players: 500
servers:
  lobby:
    address: localhost:25565
    restricted: false
    motd: '&aMain Lobby'
  survival:
    address: localhost:25566
    restricted: false
    motd: '&bSurvival Server'
permissions:
  default:
  - bungeecord.command.list
  - bungeecord.command.server
  admin:
  - bungeecord.command.alert
  - bungeecord.command.end
ip_forward: true