Destroy ArmorStand upon collision

Discussion in 'Plugin Development' started by new-ewrs728, Dec 24, 2018.

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

    new-ewrs728

    Hey. I create an ArmorStand, and I need to make it so that, for example, when it collides with a block, it will be destroyed. I think I need to register damage event...
     
  2. Offline

    Zombie_Striker

    @new-ewrs728
    Create a bukkit runnable. Every tick, get the armorstand's location and velocity. If it going to collide with a block, destroy it.
     
  3. Offline

    new-ewrs728

    Well, the question is how to check whether he encountered
     
  4. Offline

    Zombie_Striker

    @new-ewrs728
    1. Get the location of the armorstand. Add the velocity. This is where the armorstand is going to be.
    2. First, check if the block at that location isSolid. If so, it is a full block, and you know it will collide.
    3. Then, for each of the other materials with collision like slabs and cauldrons, you will need to check if the armorstand will be able to pass through/walk on the material. I don't think there is a util yet that stores all this information, so you will need to write it. I'd recommend just focusing on blocks you think is most likely to be collided with.
     
  5. Offline

    new-ewrs728

    Thank you, but I was advised that, and I think this is a more optimized way. Only I do not understand one thing, check with scheduler?
    mi930.JPG
     
Thread Status:
Not open for further replies.

Share This Page