Jump to content

[Solved]Event for detecting when player places a block


omk

Recommended Posts

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)

Link to comment
Share on other sites

Something like PlayerInteractEvent? Just check if the type is RIGHT_CLICK_BLOCK

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!

 

 

width=635 height=903http://bit.ly/HZ03zy[/img]

 

 

Tired of waiting for mods to port to bukkit?

use BukkitForge! (now with a working version of WorldEdit!)

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.