Does anyone know what is wrong with this? It wont even pickup in game that a plugin is installed. Code: import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.plugin.java.JavaPlugin; public class Basic extends JavaPlugin { public static Basic plugin; public Basic(Basic instance) { public static Basic plugin; plugin BasicPlayerListener(Basic instance) { plugin = instance; } public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){ if(cmd.getName().equalsIgnoreCase("L")){ public void onPlayerMove(PlayerMoveEvent event){ Player player = event.getPlayer(); Location playerLoc = player.getLocation(); player.sendMessage("Your X Coordinates : " + playerLoc.getX()); player.sendMessage("Your Y Coordinates : " + playerLoc.getX()); player.sendMessage("Your Z Coordinates : " + playerLoc.getX()); } return true; } return false; } } Here is the Yml file. Code: name: Basic main: me.colby.Basic.Basic version: 1.0.0 author: colby description: > My fisrt plugin. commands: L: description: Shows your player location usage: |
this should be on the Development section and yes you have nothing enabeling the plugin here is the start of my plugin Code: package scranner.colourchat; import java.util.logging.Logger; import org.bukkit.ChatColor; import org.bukkit.Server; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.Event; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; public class colourchat extends JavaPlugin { private final signlistener signListener = new signlistener(this); Logger log = Logger.getLogger("Minecraft"); public void onDisable() { log.info("Plugin enabled"); public void onEnable() { PluginManager pm = getServer().getPluginManager(); pm.registerEvent(Event.Type.SIGN_CHANGE, this.signListener, Event.Priority.Monitor, this); log.info("plugin disabled"); }
Code:java public void onDisable() { //Plugin Disabled} public void onEnable() { //Plugin enabled. } Copy and paste after: Code:java plugin BasicPlayerListener(Basic instance) { plugin = instance; }
Weird :S When you extend JavaPlugin it should be underlined with red and should give you the option : "Implement unimplemented methods or something like that " that way you should have noticed something was missing XD
Here's what it looks like now,still not registering that it's installed on the server. Code: package me.colby.Basic; import org.bukkit.Location; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; public class Basic extends JavaPlugin { public static Basic plugin; Plugin BasicPlayerListener(Basic instance) { plugin = instance; } public void onDisable() { //Plugin Disabled } public void onEnable() { //Plugin enabled. } Plugin instance; public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){ if(cmd.getName().equalsIgnoreCase("L")){ public void onPlayerMove(PlayerMoveEvent event){ Player player = event.getPlayer(); Location playerLoc = player.getLocation(); player.sendMessage("Your X Coordinates : " + playerLoc.getX()); player.sendMessage("Your Y Coordinates : " + playerLoc.getX()); player.sendMessage("Your Z Coordinates : " + playerLoc.getX()); } } } return true; } return false; } }
add this public static final Logger log = Logger.getLogger("Minecraft"); then do log.info("plugin enabled"); into onEnable and the other one in disable, then it should tell you its getting loaded D: also make sure you register the event and put it into your plugin.yml
I'm sorry for all the questions i'm just confused. Here is a pic of my coding i'm still getting errors. Also how do I register then event into my yml folder? Here's the yml at the moment. Code: name: Basic main: me.colby.Basic.Basic version: 1.0.0 author: colby description: > My fisrt plugin. commands: L: description: Shows your player location usage: /<command>