hi i am thinking about making a plugin (i have made plugins before) that when /give stuff it will check if the players name is: <players name> And allow or deny the command to run. So basically if players name is TheHolyOne then let them /give stuff if not TheHolyOne don't do anything. So is this possible?
@segovo That can be achieved fairly easily: Code: Player target = // get the player object here // check if the player in question has the name you are looking for if (target.getName().equalsIgnoreCase("TheHolyOne")) { // This will run if the targeted player is named TheHolyOne } else { // This will run if the targeted player is not named TheHolyOne }
Code: Player p = (Player) sender; String pname = "myname" if (p.getName().equalsIgnoreCase(myname) { p.sendMessage("You have the name " + p.getName()); } else { p.sendMessage("You have the name " + p.getName() + ", not the name " + myname); }