froxypie_
๐Ÿ“Ž 1 file 1,160 chars
๐Ÿ“„
kodari_announce_prompt (1).txt
txt 50 lines
โ–ถ
KODARI AI PROMPT โ€“ CENTER SCREEN ANNOUNCEMENT PLUGIN

Create a Minecraft PaperMC plugin for version 1.21+.

GOAL
Allow admins to announce messages that appear in the center of the screen for all online players.

REQUIREMENTS
- Add a command:
  /announce 

- Command usage:
  - Console
  - Players with permission announce.admin or OP

- When the command is executed:
  - Show the message as a TITLE in the center of the screen to all online players
  - Message must be large and clearly visible
  - Support color codes using &

- Title timings:
  - Fade in: 10 ticks
  - Stay: 60 ticks
  - Fade out: 10 ticks

- Play a notification sound to all players when the title appears:
  BLOCK_NOTE_BLOCK_PLING

- No emojis anywhere
- Plugin must be optimized and lag-free

ERROR HANDLING
- If no message is provided, send:
  Usage: /announce 

- Prevent non-admin players from using the command

EXAMPLE
Command:
/announce Server will restart in 5 minutes

Result:
- All players see the message in the center of the screen
- Sound plays once

OUTPUT
- Provide full Java source code
- Include plugin.yml
- Code must be error-free and ready to compile
Kodari AI
KodariJan 30 at 9:36 am 4,083 (v2)

Iโ€™ll create a centered announcement plugin for PaperMC 1.21+.

AnnouncePlugin
A lightweight announcement plugin that displays centered title messages to all online players with sound notifications. Features admin-only command with color code support and configurable title timings for server-wide broadcasts.

Done! The plugin is ready with:

Features:

  • /announce <message> command with color code support using &

  • Permission announce.admin (default: OP)

  • Console and player usage supported

  • Title timings: 10 ticks fade in, 60 ticks stay, 10 ticks fade out

  • Plays BLOCK_NOTE_BLOCK_PLING sound using XSound for cross-version compatibility

  • Proper error handling for missing message and insufficient permissions

  • Optimized and lag-free

Usage Example:

Plain Text
/announce &cServer will restart in 5 minutes

All players will see a red centered title message with a pleasant notification sound.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
4 102
src/main/java/com/kodari/announce/AnnouncePlugin.java
package com.kodari.announce;

import org.bukkit.plugin.java.JavaPlugin;

public class AnnouncePlugin extends JavaPlugin {
    
    @Override
    public void onEnable() {
        this.getCommand("announce").setExecutor(new AnnounceCommand());
        getLogger().info("AnnouncePlugin has been enabled");
    }
    
    @Override
    public void onDisable() {
        getLogger().info("AnnouncePlugin has been disabled");
    }
}