halogamer
šŸ“Ž 1 file 1,644 chars
šŸ“„
pasted-code-1791073721305.txt
txt 48 lines
ā–¶
Make me a Minecraft Paper plugin for 1.21.11 called TrollPlugin.

Only operators should be able to use the troll commands, and every command should target a specific online player.

Commands:

/keyboard 

* Temporarily disables the player's keyboard/movement controls for a configurable number of seconds.
* After the timer ends, their controls return to normal.
* Default duration: 5 seconds.

/freeze 

* Completely freezes the player in place.
* They cannot move, jump, look around, or interact.
* They cannot take or deal damage while frozen.
* Make the freeze duration configurable.

/unfreeze 

* Immediately removes the freeze.

/troll 

* Opens a menu with all available troll effects that can be used on the player.

Add several other harmless troll effects, such as:

* Fake lag effect
* Temporary blindness
* Randomly changing the player's screen messages
* Fake achievement/message notifications
* Temporary upside-down visual effect if possible
* Fake teleport message without actually moving the player
* Play random harmless sounds around the player
* Temporary potion effects

Important:

* Trolls must not permanently damage, kill, or remove items from players.
* All troll durations should be configurable in config.yml.
* Add permissions so only operators can use the commands.
* Add /troll reload to reload the configuration.
* Include clear command usage and error messages.
* Make sure the plugin works properly on Paper 1.21.11.
* Keep the plugin lightweight and make sure all effects automatically clean themselves up when their timers end.
Kodari AI
KodariOct 4 at 12:34 am 1
TrollPlugin
A Paper 1.21.11 plugin providing operator-only troll commands targeting online players. Features /keyboard to temporarily disable movement controls, /freeze and /unfreeze for complete player immobilization with damage immunity, and /troll opening a GUI menu of harmless effects. Additional effects include fake lag, temporary blindness, randomized screen messages, fake achievement notifications, upside-down visual, fake teleport messages, random sounds, and temporary potion effects. All durations configurable in config.yml with /troll reload support. Effects are non-destructive, self-cleaning, and permission-gated for operators only.
  1. Create the Paper plugin setup and default configuration.

  2. Implement operator-only commands, timed effects, freeze protections, and the target-selection menu.

Created TrollPlugin with operator-only /keyboard, /freeze, /unfreeze, and /troll commands, plus /troll reload. The troll menu includes timed effects; durations and message intervals are configurable in config.yml. Freeze blocks movement, looking, interaction, and damage, and effects clean up when they expire or the player leaves.

The upside-down effect is a temporary on-screen illusion rather than an inverted player model.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
9 856
src/main/java/com/kodari/trollplugin/TrollPlugin.java
package com.kodari.trollplugin;

import org.bukkit.plugin.java.JavaPlugin;

public final class TrollPlugin extends JavaPlugin {
    private TrollManager trollManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        trollManager = new TrollManager(this);
        TrollMenu trollMenu = new TrollMenu(this, trollManager);
        TrollCommand trollCommand = new TrollCommand(this, trollManager, trollMenu);

        getServer().getPluginManager().registerEvents(trollManager, this);
        getServer().getPluginManager().registerEvents(trollMenu, this);

        getCommand("keyboard").setExecutor(trollCommand);
        getCommand("keyboard").setTabCompleter(trollCommand);
        getCommand("freeze").setExecutor(trollCommand);
        getCommand("freeze").setTabCompleter(trollCommand);
        getCommand("unfreeze").setExecutor(trollCommand);
        getCommand("unfreeze").setTabCompleter(trollCommand);
        getCommand("troll").setExecutor(trollCommand);
        getCommand("troll").setTabCompleter(trollCommand);
    }

    @Override
    public void onDisable() {
        if (trollManager != null) {
            trollManager.shutdown();
        }
    }
}