Solved Cannot use portal with passenger??

Discussion in 'Spigot Plugin Development' started by Maxx_Qc, Feb 3, 2020.

  1. Hey guys, so when a player joins the game I had an invisible armor stand (packet) as his passenger. But the player isn't able to go through end nor nether portal. I tried removing the armor stand as his passenger and now it works fine. I tried using the PlayerPortalEvent and PlayerTeleportEvent to clear the player's passengers but it didn't work. Does anyone have any workaround idea?

    Thanks :)
     
  2. A hacky way of doing it would be on the PlayerPortalEvent to just manually teleport the player where they are supposed to go
     
  3. The event doesn't trigger until the player actually teleports.
    Instead, I had to use the PacketPlayOutMount event to set the armor stand as a passenger.
    Thanks tho
     
    #3 Maxx_Qc, Feb 3, 2020
    Last edited: Feb 3, 2020
  4. So unfortunately PacketPlayOutMount doesn't follow the player. Whenever the player moves, the entity stays there. Please help :cry:
     
  5. Maybe on player move event, check if the blocks the player is walking into are portal blocks, and remove the passenger? Then after they teleport, put it back.
     
  6. This may cause a lot of lag, might just give up then lol
     
  7. Idk what kind of project you are working on/how many players your server will have. But I don’t think checking the block in PlayerMoveEvent should cause any lag. If you need to you could even check if the block coordinates of a player’s location change before getting the block.