omk Posted November 19, 2012 Posted November 19, 2012 Hi, Ive been searching the code, documentation and the web for a few days now trying to find a way to detect when the player places out a block. I cant seem to find the way to do this in forge. Any1 who could point me in the right direction? Edit: Ive figured out a bit more: I want to use the World.addBlockEvent(), but Im having some problems understanding the event system. Getting a mod to use the event classes that are already defined I understand, but Im not sure how and where I would use World.addBlockEvent() to create an event when the player places out a block, and then understanding how to catch that event in a mod afterwards. Oh, and in case it would matter in terms of how to do this: Im planning on doing this for SMP. Edit2: Ok, I guess I should be abit more specific on what I want to achieve with the mod: Basically I want a server mod that gives players creativemode access to certain blocks, even when in survival. The plan is to have a config file that keeps track of which blocks the server allows this behaviour on, then just +1 item count in inventory on those blocks when its count < 1(or something like that) Quote
keepcalm Posted November 19, 2012 Posted November 19, 2012 Something like PlayerInteractEvent? Just check if the type is RIGHT_CLICK_BLOCK Quote Protip: try and find answers yourself before asking on the forum. It's pretty likely that there is an answer. Was I helpful? Give me a thank you! http://bit.ly/HZ03zy[/img] Tired of waiting for mods to port to bukkit? use BukkitForge! (now with a working version of WorldEdit!)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.