From c75914aa8d2e54a4e704df294d6eb9d4992cfc6f Mon Sep 17 00:00:00 2001 From: Typo <65763026+TYPOPLAYS@users.noreply.github.com> Date: Fri, 20 Feb 2026 10:22:02 +1100 Subject: [PATCH 1/3] Add support for vanishing other players --- src/main/java/de/mcmdev/vanish/command/VanishCommand.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/de/mcmdev/vanish/command/VanishCommand.java b/src/main/java/de/mcmdev/vanish/command/VanishCommand.java index 4a52ca9..61963dc 100644 --- a/src/main/java/de/mcmdev/vanish/command/VanishCommand.java +++ b/src/main/java/de/mcmdev/vanish/command/VanishCommand.java @@ -24,6 +24,7 @@ import de.mcmdev.vanish.VanishPlugin; import de.mcmdev.vanish.api.VanishApi; import de.mcmdev.vanish.config.Config; +import io.papermc.paper.command.brigadier.argument.ArgumentTypes; import io.papermc.paper.command.brigadier.CommandSourceStack; import io.papermc.paper.command.brigadier.Commands; import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents; @@ -52,6 +53,10 @@ private LiteralCommandNode createCommandNode() { return Commands.literal("vanish") .requires(commandSourceStack -> commandSourceStack.getSender().hasPermission("vanish.command")) .executes(this::run) + .then( + Commands.argument("target", ArgumentTypes.player()) + .executes(this::run) + ) .then( Commands.literal("setlevel") .requires(commandSourceStack -> commandSourceStack.getSender().hasPermission("vanish.command.setlevel")) From 0b2491e2956427498d02e91cd6f78d3fe4db4d21 Mon Sep 17 00:00:00 2001 From: Typo <65763026+TYPOPLAYS@users.noreply.github.com> Date: Fri, 20 Feb 2026 10:32:49 +1100 Subject: [PATCH 2/3] Fixed to made properly vanish others. --- .../mcmdev/vanish/command/VanishCommand.java | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/main/java/de/mcmdev/vanish/command/VanishCommand.java b/src/main/java/de/mcmdev/vanish/command/VanishCommand.java index 61963dc..10c4cbd 100644 --- a/src/main/java/de/mcmdev/vanish/command/VanishCommand.java +++ b/src/main/java/de/mcmdev/vanish/command/VanishCommand.java @@ -24,7 +24,6 @@ import de.mcmdev.vanish.VanishPlugin; import de.mcmdev.vanish.api.VanishApi; import de.mcmdev.vanish.config.Config; -import io.papermc.paper.command.brigadier.argument.ArgumentTypes; import io.papermc.paper.command.brigadier.CommandSourceStack; import io.papermc.paper.command.brigadier.Commands; import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents; @@ -51,18 +50,22 @@ public void register() { private LiteralCommandNode createCommandNode() { return Commands.literal("vanish") - .requires(commandSourceStack -> commandSourceStack.getSender().hasPermission("vanish.command")) + .requires(source -> source.getSender().hasPermission("vanish.command")) .executes(this::run) .then( Commands.argument("target", ArgumentTypes.player()) + .requires(source -> source.getSender().hasPermission("vanish.command.others")) .executes(this::run) ) .then( Commands.literal("setlevel") - .requires(commandSourceStack -> commandSourceStack.getSender().hasPermission("vanish.command.setlevel")) + .requires(source -> source.getSender().hasPermission("vanish.command.setlevel")) .executes(this::runSetlevel) .then( - Commands.argument("level", IntegerArgumentType.integer(0, config.maximumHidingLevel())) + Commands.argument( + "level", + IntegerArgumentType.integer(0, config.maximumHidingLevel()) + ) .executes(this::runSetlevelLevel) ) ) @@ -70,16 +73,24 @@ private LiteralCommandNode createCommandNode() { } private int run(final CommandContext context) { - if (!(context.getSource().getExecutor() instanceof final Player player)) { - return 1; + + Player target; + + if (context.getArguments().containsKey("target")) { + target = context.getArgument("target", Player.class); + } else { + if (!(context.getSource().getExecutor() instanceof Player player)) { + return 1; + } + target = player; } - if (vanishApi.isVanished(player)) { - vanishApi.unvanish(player); - config.messages().toggleOff().send(player); + if (vanishApi.isVanished(target)) { + vanishApi.unvanish(target); + config.messages().toggleOff().send(target); } else { - vanishApi.vanish(player); - config.messages().toggleOn().send(player); + vanishApi.vanish(target); + config.messages().toggleOn().send(target); } return 0; From 976d9cb9e2460297fe90075a154c9bdb86de9176 Mon Sep 17 00:00:00 2001 From: Typo <65763026+TYPOPLAYS@users.noreply.github.com> Date: Fri, 20 Feb 2026 10:33:22 +1100 Subject: [PATCH 3/3] added proper import --- src/main/java/de/mcmdev/vanish/command/VanishCommand.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/de/mcmdev/vanish/command/VanishCommand.java b/src/main/java/de/mcmdev/vanish/command/VanishCommand.java index 10c4cbd..20bf00c 100644 --- a/src/main/java/de/mcmdev/vanish/command/VanishCommand.java +++ b/src/main/java/de/mcmdev/vanish/command/VanishCommand.java @@ -24,6 +24,7 @@ import de.mcmdev.vanish.VanishPlugin; import de.mcmdev.vanish.api.VanishApi; import de.mcmdev.vanish.config.Config; +import io.papermc.paper.command.brigadier.argument.ArgumentTypes; import io.papermc.paper.command.brigadier.CommandSourceStack; import io.papermc.paper.command.brigadier.Commands; import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents;