2023-11-11latestUpdated for 1.20Nov 11, 2023 Updated for Minecraft 1.20.3.0Recompiled for 1.16Dec 19, 2020 Recompiled for 1.162017-09-30general improvementsSep 30, 2017 Sometimes you just gotta snoop on all the players on your server. To install this plugin, copy the plugin JAR file to your server's plugins folder. Issue /SNOOP to use it. You can also issue SNOOP from the console. Code (Text): package FredashaySpigotSnoop; import java.util.List; import java.util.logging.Logger; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.Listener; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; public class MyPlugin extends JavaPlugin implements Listener, CommandExecutor { private static Logger logger = null; private static PluginDescriptionFile pdfFile = null; @Override public void onEnable() { pdfFile = getDescription(); getServer().getPluginManager().registerEvents(this,this); logger = Logger.getLogger("Minecraft"); } @SuppressWarnings("unchecked") @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (label.equalsIgnoreCase("snoop")) { logger.info("[" + pdfFile.getName() + "] Player '" + sender.getName() + "' snooped on the other players. "); Player player = null; List<Player> allPlayers = (List<Player>) getServer().getOnlinePlayers(); int playerIx = 0; String output = null; if (allPlayers.size() <= 0) { sender.sendMessage("<SNOOP> No players are logged on right now. "); } else while (playerIx < allPlayers.size()) { player = allPlayers.get(playerIx); output = "<SNOOP> Player '" + player.getName() + "' is in " + player.getLocation().getWorld().getName() + " at (" + player.getLocation().getBlockX() + ", " + player.getLocation().getBlockZ() + "). "; output = output + "Player is in " + player.getGameMode() + " mode. "; if (player.isOp()) { output = output + "Player is Op. "; } output = output + "Player is carrying "; if ((player.getInventory().getItemInMainHand().getType() == Material.AIR) && (player.getInventory().getItemInOffHand().getType() == Material.AIR)) { output = output + "nothing. "; } else { if (player.getInventory().getItemInMainHand().getType() != Material.AIR) { output = output + player.getInventory().getItemInMainHand().getType().name(); if (player.getInventory().getItemInOffHand().getType() != Material.AIR) { output = output + " and "; } } if (player.getInventory().getItemInOffHand().getType() != Material.AIR) { output = output + player.getInventory().getItemInOffHand().getType().name(); } output = output + ". "; } if (player.getBedSpawnLocation() == null) { output = output + "Player has no bed. "; } else { output = output + "Player's bed is in " + player.getBedSpawnLocation().getWorld().getName() + " at (" + player.getBedSpawnLocation().getBlockX() + ", " + player.getBedSpawnLocation().getBlockZ() + "). ";; } sender.sendMessage(output); playerIx = playerIx + 1; } return (true); } return (false); } // public void doNothing() { } }2017-09-19Sep 20, 2017
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta