b13_on
📎 1 file 5,394 chars
📄
pasted-code-1773501327299.txt
txt 339 lines
▶
Here is a **clean prompt you can paste directly into Kodari.ai** to generate a **Paper 1.21 plugin** implementing everything. It is written so the AI builds the whole plugin itself.

---

**Prompt for Kodari.ai**

Create a **fully functional Minecraft Paper 1.21+ plugin** written in **Java** that recreates and combines features similar to the mods:

* Death Sound Mod
* StasisRods
* VillagerOptimizer

The plugin must **NOT depend on Fabric or Forge mods**. Everything must be implemented directly using the **Paper API**.

The plugin should be **well-structured**, modular, optimized, and include **config.yml**, permissions, and clean code architecture.

---

# Core Features

## 1. Death Sound System

Recreate the behavior of the Death Sound mod.

When a player dies:

* Play a configurable sound to all players.
* Sound should be configurable in config.yml.
* Optionally broadcast the player's death message with formatting.

Example config:

```yaml
death-sound:
  enabled: true
  sound: entity.wither.death
  volume: 1.0
  pitch: 1.0
```

---

# 2. Stasis Fishing Rods

Recreate **StasisRods functionality but using fishing rods**.

Mechanic:

When a player right-clicks with a fishing rod:

1. It stores the player's current location as a **stasis point**.
2. When the rod is used again, the player **teleports back to the stored location**.

Features:

* Each player can only have **1 stasis location**.
* Stored per player using UUID.
* Config option to require permission.
* Cooldown support.

Example config:

```yaml
stasis:
  enabled: true
  cooldown: 5
```

---

# Commands

## /immortality (player)

Makes a player **completely unable to die**.

Rules:

* Damage cannot kill them.
* They stay at **1 HP instead of dying**.
* Totems of Undying can still activate normally.
* Toggle system:

```
/immortality Notch
```

Running again disables immortality.

Permission:

```
plugin.immortality
```

---

## /announce title (message)

Displays a **server-wide title message**.

Example:

```
/announce title Server restarting in 5 minutes
```

Behavior:

* Sends TITLE and SUBTITLE animation to all players.
* Configurable fade times.

Permission:

```
plugin.announce
```

---

## /string

Fills every empty inventory slot with **string items**.

Example:

```
/string
```

Behavior:

* Checks player's inventory
* Every empty slot becomes `minecraft:string`

Permission:

```
plugin.string
```

---

# Hopper Optimization

Modify hopper mechanics:

* Hoppers move **16 items per transfer instead of 1**
* Maintain **low lag**
* Avoid unnecessary tick scans
* Must be optimized for large servers.

Config:

```yaml
hoppers:
  items-per-transfer: 16
```

---

# TPA System

Create a full teleport request system.

Commands:

```
/tpa (player)
/tpahere (player)
/tpauto
```

Behavior:

### /tpa

Request teleport to another player.

### /tpahere

Request another player to teleport to you.

### /tpauto

Automatically accept all teleport requests.

Features:

* **5 second teleport warmup**
* Movement cancels teleport
* Cooldown between requests
* Accept / deny system

Extra commands:

```
/tpaccept
/tpdeny
```

Config:

```yaml
tpa:
  warmup: 5
  cooldown: 10
```

---

# Infinite Villager Trading

Villagers should:

* **Never lock trades**
* Trades never disable
* Trading remains vanilla balanced.

This should hook into villager trade logic and reset uses automatically.

---

# One Player Sleep

If **1 player sleeps**, the night skips.

Features:

* Broadcast message
* Configurable percentage option

Example config:

```yaml
sleep:
  required-percentage: 1
```

---

# Villager Optimization System

Implement logic similar to **VillagerOptimizer**.

Features:

* Reduce villager AI tick rate when idle
* Stop unnecessary pathfinding
* Improve server performance
* Configurable activation radius

Example config:

```yaml
villagers:
  optimization: true
  activation-range: 16
```

---

# Config System

Everything must be configurable in `config.yml`.

Include:

* sounds
* cooldowns
* teleport delays
* hopper transfer rate
* villager optimization settings

---

# Permissions

Add permissions for all commands.

Example:

```
plugin.tpa
plugin.tpahere
plugin.tpauto
plugin.string
plugin.announce
plugin.immortality
```

---

# Technical Requirements

The plugin must:

* Support **Paper 1.21+**
* Be **high performance**
* Avoid laggy loops
* Use **events instead of polling**
* Store data with **UUID-based maps**
* Be structured with packages:

```
commands/
systems/
listeners/
managers/
utils/
```

---

# Extra Quality Features

Also implement:

* Tab completion
* Clean message formatting
* Config reload command:

```
/plugin reload
```

* Actionbar messages for teleports
* Logging for debugging

---

If you want, I can also give you a **much stronger Kodari prompt (like 10x better)** that forces it to generate:

* **citizens-compatible NPC systems**
* **INVENTORY GUI config editors**
* **async teleport handling**
* **extreme hopper optimization**

which makes the plugin way more **professional / premium-quality**.
Kodari AI
KodariMar 14 at 3:17 pm 19,253 (v2)

I’ll create a comprehensive Paper 1.21+ plugin implementing all the requested features.

ServerEssentials
A high-performance Paper plugin combining death sounds, stasis fishing rods, immortality system, teleport requests with warmup, hopper optimization, infinite villager trading, one-player sleep, villager AI optimization, and utility commands. Features include configurable sounds, cooldowns, teleport delays, and per-player data tracking with UUID-based storage for optimal server performance.

All files created successfully! The ServerEssentials plugin implements all requested features: death sounds with XSound, stasis fishing rods with location storage, immortality system preventing death at 1HP, TPA system with warmup/cooldown/auto-accept, hopper optimization for bulk transfer, infinite villager trading, one-player sleep mechanics, villager AI optimization, and utility commands for announcements and inventory filling.

b13_on

make it so u can pop a totem with immortality but cant die

Kodari AI
KodariMar 14 at 3:40 pm 8,544 (v2)

I’ll read the immortality-related files to understand the current implementation and modify it to allow totem popping while maintaining immortality protection.

I’ll modify the ImmortalityListener to allow totem popping while maintaining immortality protection. The key is to let the damage process if the player has a totem, then ensure they don’t die afterwards.

Modified ImmortalityListener to allow totem popping while maintaining immortality - if player has a totem, it lets the damage through so totem can pop, then ensures player survives with a delayed task. If no totem, prevents death as before. Also added death event handler as failsafe.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
23 1,395
src/main/java/com/serveressentials/ServerEssentials.java
package com.serveressentials;

import com.serveressentials.commands.*;
import com.serveressentials.listeners.*;
import com.serveressentials.managers.*;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class ServerEssentials extends JavaPlugin {
    
    private StasisManager stasisManager;
    private ImmortalityManager immortalityManager;
    private TpaManager tpaManager;
    private VillagerManager villagerManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        stasisManager = new StasisManager();
        immortalityManager = new ImmortalityManager();
        tpaManager = new TpaManager(this);
        villagerManager = new VillagerManager(this);
        
        registerCommands();
        registerListeners();
        
        getLogger().info("ServerEssentials has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (tpaManager != null) {
            tpaManager.shutdown();
        }
        if (villagerManager != null) {
            villagerManager.shutdown();
        }
        getLogger().info("ServerEssentials has been disabled!");
    }
    
    private void registerCommands() {
        getCommand("immortality").setExecutor(new ImmortalityCommand(this));
        getCommand("announce").setExecutor(new AnnounceCommand(this));
        getCommand("string").setExecutor(new StringCommand(this));
        getCommand("tpa").setExecutor(new TpaCommand(this));
        getCommand("tpahere").setExecutor(new TpaHereCommand(this));
        getCommand("tpauto").setExecutor(new TpaAutoCommand(this));
        getCommand("tpaccept").setExecutor(new TpAcceptCommand(this));
        getCommand("tpdeny").setExecutor(new TpDenyCommand(this));
    }
    
    private void registerListeners() {
        getServer().getPluginManager().registerEvents(new DeathSoundListener(this), this);
        getServer().getPluginManager().registerEvents(new StasisRodListener(this), this);
        getServer().getPluginManager().registerEvents(new ImmortalityListener(this), this);
        getServer().getPluginManager().registerEvents(new HopperListener(this), this);
        getServer().getPluginManager().registerEvents(new SleepListener(this), this);
        getServer().getPluginManager().registerEvents(new VillagerListener(this), this);
    }
    
    public String colorize(String message) {
        return message.replace("&", "§");
    }
}