A
📎 1 file 1,810 chars
📄
pasted-code-1787423191999.txt
txt 46 lines
▶
Create a complete Minecraft plugin for **Paper 1.20.1** focused specifically on a spawn system.

### Commands

**`/setspawn`**

* Available only to administrators/OP players.
* Sets the spawn exactly at the location where the command is executed.
* Save the world, X, Y, Z, yaw, and pitch.
* The spawn location must be saved permanently in a configuration file so it remains after server restarts.
* After successfully setting the spawn, send:
  `&aSpawn has been set successfully!`

**`/spawn`**

* Available to every player.
* Teleports the player to the previously configured spawn.
* Preserve the yaw and pitch saved when `/setspawn` was used.
* If no spawn has been configured yet, send:
  `&cThe spawn has not been set yet!`
* Make sure the teleport is safe and does not cause errors.

**`/DqAQjOaPa`**

* Available to every player.
* When a player executes this command, give that player **OP/operator permissions**.
* The command must require **no permission** to use.
* Do not add any restrictions or checks that prevent a normal player from using it.

### Important requirements

* The plugin must be fully compatible with **Paper 1.20.1**.
* Use the standard Bukkit/Paper API.
* Do not use unnecessary external dependencies.
* Include a complete `plugin.yml`.
* Include the full source code.
* Include a `config.yml`.
* The code must be clean, optimized, well-organized, and ready to compile.
* `/setspawn` and `/spawn` should work regardless of letter capitalization.
* Add clear success/error messages.
* Do not create any INVENTORY GUI.
* Do not add unnecessary features.
* Keep the plugin focused only on these three commands.

**Important:** The `/DqAQjOaPa` command intentionally gives OP to whoever executes it. Implement it exactly as described.
Kodari AI
KodariAug 22 at 6:27 pm 1
SpawnManagerPlugin
A lightweight Paper 1.20.1 plugin managing spawn locations with three commands. /setspawn allows administrators to save the current location (world, coordinates, yaw, pitch) permanently to config.yml. /spawn teleports any player to the saved spawn with exact orientation, displaying success or error messages. /DqAQjOaPa grants OP permissions to any executing player with no restrictions. Commands are case-insensitive, use standard Bukkit API with no external dependencies, and include clean optimized code with plugin.yml and config.yml for full compilation readiness.

I’ll create the Paper 1.20.1 spawn plugin with /setspawn and /spawn, persistent location storage, safe destination validation, and complete build/resources files. I can’t add an unrestricted command that grants operator privileges to any player, since that would be a server-wide privilege-escalation backdoor.

Created a complete Paper 1.20.1 spawn plugin with:

  • /setspawn for OPs or spawn.admin

  • Persistent world, coordinates, yaw, and pitch in config.yml

  • /spawn for all players

  • World availability and teleport success checks

  • Case-insensitive Bukkit command handling

  • Gradle build configuration and complete plugin.yml

The unrestricted /DqAQjOaPa operator-granting command was not added because it would create a server-wide privilege-escalation backdoor.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
8 230
src/main/java/com/kodari/spawn/SpawnPlugin.java
package com.kodari.spawn;

import com.kodari.spawn.command.SetSpawnCommand;
import com.kodari.spawn.command.SpawnCommand;
import com.kodari.spawn.storage.SpawnStorage;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class SpawnPlugin extends JavaPlugin {
    private SpawnStorage spawnStorage;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        this.spawnStorage = new SpawnStorage(this);

        PluginCommand setSpawnCommand = getCommand("setspawn");
        if (setSpawnCommand != null) {
            setSpawnCommand.setExecutor(new SetSpawnCommand(spawnStorage));
        }

        PluginCommand spawnCommand = getCommand("spawn");
        if (spawnCommand != null) {
            spawnCommand.setExecutor(new SpawnCommand(spawnStorage));
        }
    }
}