Falling Block

Discussion in 'Plugin Development' started by Da_Co0k1eZ, Feb 16, 2014.

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

    Da_Co0k1eZ

    How can you remove the gravity effect of a falling block? I want to make the falling block float in mid air, but can't seem to do it. I tried using a timer and constantly moving it up by the difference every tick but it just looked awkward.

    Bump.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  2. Da_Co0k1eZ
    I think EntityChangeBlockEvent is triggered when blocks fall. Try that, and just cancel the event.
     
  3. Offline

    Da_Co0k1eZ

    Im_Zeus
    Ok, but how to I grab the EntityChangeBlockEvent class and cancel for just the block falling?
     
  4. Offline

    Gater12

    Im_Zeus
    I believe that's fired when the falling block turns into a solid block.

    Da_Co0k1eZ
    "You can't just ignore gravity"
     
  5. Offline

    Da_Co0k1eZ

    Gater12
    Well you could if you created a new entity type that doesn't move the Y axis.
     
  6. Gater12 Da_Co0k1eZ Meh, it was worth a try. Try BlockPhysicsEvent, and cancel that. If that doesn't work, then listen to BlockEvents, and print(event.getEventName()) and drop a physics-bound blocks(sand, gravel, etc)
     
    Gater12 likes this.
  7. Offline

    Da_Co0k1eZ

    Im_Zeus
    Wouldn't that cancel all movement?
     
  8. If you cancelled ALL BlockPhysicsEvents, then yes no blocks will fall.
    It will not cancel PlayerMoveEvents, if that's what you're asking?
     
  9. Offline

    Da_Co0k1eZ

    Im_Zeus
    No, I know that it won't cancel the player move event. I was saying that wouldn't it cancel movement on the x and z axis as well.
     
  10. I don't imagine it would, since it is a BlockPhysicsEvent. Should only affect the y axis. I DO NOT know this for sure, as I've never used the event.
     
  11. Offline

    Da_Co0k1eZ

    Im_Zeus
    Hmm, It's worth a try. How would I get the physics event for just the block?

    I tried setting all BlockPhysicsEvent to canceled so that they would stop falling, but it didn't seem to work. Any ideas?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  12. Offline

    Da_Co0k1eZ

    Im_Zeus
    Can't listen to blockevents
     
  13. Offline

    maxben34

    Da_Co0k1eZ
    Here's the trick. You need to use NBT data edited minecarts.

    I'm not even kidding. It's the only way to do it sorry.
     
Thread Status:
Not open for further replies.

Share This Page