Floating blocks

Discussion in 'Plugin Development' started by JRL1004, Jul 22, 2014.

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

    JRL1004

    I've been trying at this for a few hours now and I just can't seem to get this to work. What I am trying to do is create a FallingBlock entity that does not fall but instead will maintain a constant altitude. I have created a very crude custom entity for this (that overwrites the h() method in the class net.minecraft.server.v1_7_R3.EntityFallingBlock) to lock the Y level but it only spawns for one tick before it stops rendering (yet continues to exist on the server side). I have viewed three separate tutorials on custom entities to see if I am missing something simple but it does not seem that I have (granted that the tutorials were about custom entities in general, not floating blocks). If anyone could give me a hand with this I would really appreciate it.
     
  2. Offline

    RingOfStorms

    If you want perfect floatiness you can mount any entity to a witherskull that isn't moving. If you want the block to also be moving and don't want to see the wither skull (it becomes visible when it's velocity is greater than 0) then you need to utilize the horse render glitch in the client.

    ase34 made an API that you can easily use http://forums.bukkit.org/threads/api-flying-blocks.246849/
     
    Garris0n likes this.
  3. Offline

    JRL1004

    RingOfStorms Wait.... The Wither Skull becomes invisible with a velocity of 0? Just checked, accelerating the FallingBlocks does not make them visible again. I don't think either of those will work and my idea is to have the block floating while players use their bodies to push the block(s) around the map. The wither skull one would be great if there was a way to make in safe for collisions.
     
  4. Offline

    RingOfStorms

    You do collisions very easily yourself. The only way to make things that normally have gravity perfectly float is to use the witherskull. And yes at 0 velocity witherskulls are invisible, but otherwise are rendered. You can use ase34's API for the blocks, and then make your own custom collision server-side.
     
Thread Status:
Not open for further replies.

Share This Page