guardianj8

Create something called "Illusion" basically it's an enchanted ender pearl, whenever the user hits someone with the item, the user will disappear for everyone, whoever they hit will be the only person that can see or hear them, no one else can, not even appearing in tab, also they cannot hit anyone, and no one can hit them, also the user of Illusion cannot take damage, but they aren't in creative mode and cannot fly, they also cannot pick up or drop items, they can't do anything that would reveal themselves to other people, and if they decide they don't want to be fake anymore, they simply can right click the item anytime to go back to their spawnpoint, also the color of the items name is Dark Purple

Kodari AI
KodariJul 10 at 7:21 am 9
Illusion
Illusion is a Minecraft plugin that provides an enchanted Dark Purple ender pearl ability. When a player strikes another player with it, the user becomes hidden from everyone except the player they hit, disappears from tab, becomes immune to damage, and cannot attack, interact, fly, drop, or pick up items. Right-clicking the Illusion item ends the effect and returns the user to their saved spawnpoint.
guardianj8

are you able to go to the internet to look at videos?

Kodari AI
KodariJul 13 at 9:33 am 2

I can access publicly available web pages and text, but I can’t directly watch or interpret videos like a person. If you share a video URL, I can check whether its page includes accessible text such as a title, description, transcript, captions, or comments.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
6 617
src/main/java/com/kodari/illusion/IllusionPlugin.java
package com.kodari.illusion;

import java.util.Map;
import java.util.Objects;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public final class IllusionPlugin extends JavaPlugin implements CommandExecutor {
    private IllusionManager illusionManager;

    @Override
    public void onEnable() {
        illusionManager = new IllusionManager(this);
        getServer().getPluginManager().registerEvents(new IllusionListener(this, illusionManager), this);
        Objects.requireNonNull(getCommand("illusion")).setExecutor(this);
    }

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

    @Override
    public boolean onCommand(
            CommandSender sender,
            Command command,
            String label,
            String[] args
    ) {
        if (!sender.hasPermission("illusion.admin")) {
            sender.sendMessage(ChatColor.RED + "You do not have permission to use this command.");
            return true;
        }

        if (args.length == 0 || !args[0].equalsIgnoreCase("give")) {
            sender.sendMessage(ChatColor.YELLOW + "Usage: /illusion give [player] [amount]");
            return true;
        }

        Player target;
        if (args.length >= 2) {
            target = Bukkit.getPlayerExact(args[1]);
            if (target == null) {
                sender.sendMessage(ChatColor.RED + "That player is not online.");
                return true;
            }
        } else if (sender instanceof Player player) {
            target = player;
        } else {
            sender.sendMessage(ChatColor.YELLOW + "Specify a player from the console.");
            return true;
        }

        int amount = 1;
        if (args.length >= 3) {
            try {
                amount = Integer.parseInt(args[2]);
            } catch (NumberFormatException exception) {
                sender.sendMessage(ChatColor.RED + "Amount must be a number.");
                return true;
            }

            if (amount < 1 || amount > 64) {
                sender.sendMessage(ChatColor.RED + "Amount must be between 1 and 64.");
                return true;
            }
        }

        ItemStack item = illusionManager.createItem();
        item.setAmount(amount);

        Map<Integer, ItemStack> leftovers = target.getInventory().addItem(item);
        leftovers.values().forEach(leftover ->
                target.getWorld().dropItemNaturally(target.getLocation(), leftover)
        );

        sender.sendMessage(ChatColor.GREEN + "Gave " + amount + " Illusion item(s) to " + target.getName() + ".");
        if (sender != target) {
            target.sendMessage(ChatColor.GREEN + "You received " + amount + " Illusion item(s).");
        }

        return true;
    }
}