Hi Pretty new to this stuff but have been programming in C#, PHP, some C++ and other languages in the past 4-5years. Now to the question... When a user interacts with a chest I want to .. do something. Like send a message to the chat. To register the event I got this in my onEnable(): Code: pm.registerEvent(Event.Type.BLOCK_INTERACT, [B]playerListener[/B], Priority.Normal, this); As you can see I placed the playerListener as listener. But should I use the blocklistener instead? Why? To me it seems more logical because Event.Type is BLOCK_* and that should go to the blockListener. On the side, how to I: 1. Post a 'global' chat message? 2. Send a private chat message to a player?
a) you need it to go to the block listener, otherwise it wont/shouldnt work. and you may want to use inventory open event (i think there is one.) To send a message to the player it is player.sendMessage("Put message here. ") and I believe Plugin.Server.announce("message") should do the trick.
Global chat message: getServer().broadcastMessage("Message here."); Private chat messsage (should be) : getServer().getPlayer("Specific player name here").sendMessage("message here.");