d9vlyyc

You need to make a plugin to create a /setjoinspawn command to make players spawn in a specific world bypassing the rest for paper version 26.1.2

Kodari AI
KodariMay 24 at 1:11 pm 3,864 (v2)

I’ll create a plugin to set a custom join spawn location that bypasses default world spawns.

JoinSpawnManager
A lightweight plugin that allows administrators to set a custom spawn location for all joining players. Players will spawn at the configured location regardless of world settings. Features a simple /setjoinspawn command that saves the admin's current position, including world, coordinates, and viewing direction. Perfect for servers that need centralized player spawning or custom lobby systems.

Let me create the plugin structure:

Plugin created successfully!

The plugin provides:

  • /setjoinspawn command to set the spawn location (requires OP or joinspawnmanager.setspawn permission)

  • Automatic teleportation on join for all players to the configured location

  • High event priority (HIGHEST) to override other spawn plugins

  • Persistent spawn location saved to config.yml with world, coordinates, and rotation

  • Safe world validation (won’t crash if the world gets deleted)

The spawn location will be used for all players joining the server, bypassing default world spawn mechanics.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
6 170
src/main/java/com/example/joinspawnmanager/JoinSpawnManager.java
package com.example.joinspawnmanager;

import org.bukkit.plugin.java.JavaPlugin;

public class JoinSpawnManager extends JavaPlugin {

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        getCommand("setjoinspawn").setExecutor(new SetJoinSpawnCommand(this));
        getServer().getPluginManager().registerEvents(new JoinListener(this), this);
        
        getLogger().info("JoinSpawnManager has been enabled!");
    }

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