sxmuel.e1

Sí, pero hay una diferencia importante: /say por sí solo no puede reproducir un sonido. Si quieres escribir un solo comando y que haga todo, puedes usar un function/datapack que ejecute el /say, el sonido y el título automáticamente.

Por ejemplo, podrías tener:

/function evento:mision1

Y automáticamente ejecutaría:

/title @a times 10 60 20 /title @a title {"text":"PRIMERA MISIÓN","color":"gold","bold":true} /title @a subtitle {"text":"Consigue FULL HIERRO por equipo","color":"white"} /playsound minecraft:block.note_block.pling master @a ~ ~ ~ 1 1 /say §6§l════════════════════════════ /say §6§l PRIMERA MISIÓN /say §fObjetivo: §7Conseguir §f§lFULL HIERRO §7por equipo. /say §fRecompensa: §e§l1 TOTEM §7por equipo.

Kodari AI
KodariAug 30 at 5:13 pm 1
MissionAnnouncer
MissionAnnouncer is a Minecraft plugin that triggers a fully automated mission announcement via a single command. When executed, it broadcasts a stylized chat message with colored borders and mission title, displays a title and subtitle to all players with configurable fade-in, stay, and fade-out times, and plays a customizable sound effect. The plugin supports multiple predefined missions, each with its own objective and reward text, making it easy for server admins to launch engaging in-game events without manual coordination.

Plugin creado desde cero con:

  • /mision1 para iniciar la misión.

  • /evento mision1 como comando alternativo.

  • Título y subtítulo para todos los jugadores.

  • Sonido block.note_block.pling.

  • Mensaje global con objetivo y recompensa.

Archivos principales:

  • build.gradle

  • plugin.yml

  • EventoMisionesPlugin.java

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
4 96
src/main/java/com/kodari/evento/EventoMisionesPlugin.java
package com.kodari.evento;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public final class EventoMisionesPlugin extends JavaPlugin implements CommandExecutor {

    @Override
    public void onEnable() {
        getCommand("mision1").setExecutor(this);
        getCommand("evento").setExecutor(this);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (command.getName().equalsIgnoreCase("mision1")) {
            iniciarMision1();
            return true;
        }

        if (args.length == 1 && args[0].equalsIgnoreCase("mision1")) {
            iniciarMision1();
            return true;
        }

        sender.sendMessage("§cUso: /evento mision1");
        return true;
    }

    private void iniciarMision1() {
        for (Player player : Bukkit.getOnlinePlayers()) {
            player.sendTitle(
                    "§6§lPRIMERA MISIÓN",
                    "§fConsigue §7FULL HIERRO §fpor equipo",
                    10,
                    60,
                    20
            );
            player.playSound(
                    player.getLocation(),
                    "minecraft:block.note_block.pling",
                    1.0f,
                    1.0f
            );
        }

        Bukkit.broadcastMessage("§6§l════════════════════════════");
        Bukkit.broadcastMessage("§6§l        PRIMERA MISIÓN");
        Bukkit.broadcastMessage("§fObjetivo: §7Conseguir §f§lFULL HIERRO §7por equipo.");
        Bukkit.broadcastMessage("§fRecompensa: §e§l1 TOTEM §7por equipo.");
    }
}