BlockPhysicsEvent

Discussion in 'Plugin Development' started by Double0negative, Apr 27, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Double0negative

    For the BlockPhysicsEvent how would i go about getting the old and new location of the block? I see no way of doing this with the current event methods.
     
  2. Offline

    desht

    I'm not sure BlockPhysicsEvent does what you think it does :) It's not fired when the location of a block changes (which is a bit of an artificial concept anyway - blocks never move), but when the type or state of a block changes. E.g. when a block is broken or a switch is toggled, a BlockPhysicsEvent is fired.

    Perhaps you're looking for the BlockFromToEvent, which is fired when liquids (water & lava) flow?
     
  3. Offline

    Double0negative

    ahh ok, thats what i was thinking. So lets say i want to get the original position of a block of sand and then the new position of that block when it "falls" what would i use?
     
  4. Offline

    desht

    I think you might be out of luck on that one. See https://bukkit.atlassian.net/browse/BUKKIT-1312

    A quick browse of the CraftBukkit source suggests that no event is fired when an EntityFallingBlock is added to the world, either, so that can't be caught.

    There's a rather hacky workaround here which might be your only option: http://forums.bukkit.org/threads/cancel-sand-gravel-falling-event.47617/
     
Thread Status:
Not open for further replies.

Share This Page