Posted September 7, 20187 yr So I wanted to know a proper way for teleporting a player and the rest of the passengers to a new location? Every time I tried getting the player to a new location he periodically just doesn't teleport with the rest of the stack. public void teleport(Entity base,int x, int y, int z) { List<Entity> stack = Arrays.asList(base.getRecursivePassengers().toArray()); stack.add(0,base); for(Entity e : stack) { e.dismountRidingEntity(); if(e instanceof EntityPlayerMP) ((EntityPlayerMP)e).connection.setPlayerLocation(x, y, z, e.rotationYaw, e.rotationPitch); e.setLocationAndAngles(x, y, z, e.rotationYaw, e.rotationPitch); } } Edited September 7, 20187 yr by nullsector76
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.