Best way to animate lava physics in a pyramid way?

Discussion in 'Plugin Development' started by Excalibur, May 11, 2014.

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


    Well first of all, this is my first post so hello! I want to join these forums because they seem like they can help me get a grasp on the Java language a bit more than I already do and learn the Bukkit API.

    I basically have a cool idea for a plugin. I want to animate lava physics in a growing like state where lava starts as one block, then grows out 1 up and 1 down in the y axis, and all around in the x axis. And continue to do so until the map is filled.

    I'm wondering if this is possible or not? I would basically need to halt the flow of lava, and just have the blocks expanding as I mentioned.
  2. Offline


    Excalibur welcome to the forums. as for your question, it is possible, just lots of math. :p first off the formulae for a pyramid is bwh/3 and for the lava, nms(net.minecraft.server code) can be used there.
  3. Offline


    To halt the physics, you'll have to use this event. As for the pyramid, doesn't seem too complicated. Certainly possible.

    No NMS necessary :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 8, 2016
    NathanWolf likes this.
  4. Offline


    Garris0n ahh thank you. that will be so much easier for a beginner. xD
  5. Offline


    Ok, thanks for the replies guys! c:

    My main question is, how do I stop lava from performing the flow to the nearby block when dropped and keep it upright? The pyramid is indeed very mathy but I think I should be fine with that. Just this one thing.
  6. Offline


    You would use the event BlockFromToEvent. Check to see if the block is a lava source block, and if so, cancel the event using event.setCancelled(true);

    If you only want to cancel lava flow in your pyramid however, that's a different story... I'm not entirely sure how to do that.
  7. MOMOTHEREAL There was no real need for that, now, was there?
  8. Offline


    I guess you have to keep the location and stuff, it would be easier to just hook to world guard/edit and define it for a region though.
  9. Offline


  10. Offline


Thread Status:
Not open for further replies.

Share This Page