Solved Make Armor Stand noclip trough blocks using velocity

Discussion in 'BungeeCord Plugin Development' started by nelson2tm, Apr 24, 2017.

Thread Status:
Not open for further replies.
  1. Code (Text):
    Vector pos = armorstand.getLocation().toVector();
    Vector target = Bukkit.getPlayer("nelson2tm").getLocation().toVector();
    Vector velocity = target.subtract(pos);
    What I'm trying to do is to move an Armor Stand from point a to b, which currently works except for one thing: it can get stuck at blocks. Is there a way to make the Armor Stand move directly through blocks using velocity, as if it were in gamemode 3 but still be visible? Teleporting does this, but I'd rather want to use velocity for this. I have no clue what to do from here.
  2. You really can't do this with velocity unless you're wiling to delve into NMS. By setting the velocity, that makes the entity move by the xyz of the velocity every tick. (the client uses velocity to predict movement and smooth it out). However, the movement checks for collisions using the entities bounding box. You'd need to make the bounding box of 0 width and height in order for this to work. Even if you do, it's difficult to say how the server will respond to a bounding box of that size.
    • Useful Useful x 1
  3. I managed to do this by using
    Code (Text):
    nmsEntity.noclip = true;
    Thanks for your help! :)
Thread Status:
Not open for further replies.