MyDog

MyDog

8k Downloads

Dogs cannot go through Nether Portals

Mikkel136 opened this issue ยท 1 comments

commented

Type of bug

Other unexpected behaviour

Error log (if applicable)

No response

Bug description

Dogs cannot travel to The Nether/The End by going through portals.

The only way to transport dogs through the Nether is by either

  1. Putting them in a Minecart, and pushing that through a Nether Portal
  2. Using /dog comehere [ID]

Steps to reproduce

  1. Be on the latest version of Paper for 1.21
  2. Place a Nether Portal and stand on top of it
  3. Dog wanders through the Nether Portal

Expected behaviour

Dogs immediately travel through portals like other entities

Actual behaviour

Dog do not travel through portals

commented

This is intentional behavior, as the dogs should always follow their owner, and not get pushed into portals and disappear.

// When a dog enters a portal, deny the teleport, since it's annoying
@EventHandler(priority = EventPriority.HIGHEST)
public void onPortalTeleport(EntityPortalEvent event) {
if (!plugin.automaticTeleportation) {
return;
}
Entity entity = event.getEntity();
if (MyDog.getDogManager().isDog(entity.getUniqueId())) {
// Make sure that the portal isn't the end portal... pretty sure there's lava under that lol
if (event.getTo() != null && event.getTo().getWorld() != null) {
if (event.getTo().getWorld().getEnvironment() != World.Environment.THE_END) {
MyDog.instance().logDebug("Stopped a dog from teleporting through a portal.");
event.setCancelled(true);
}
}
}
}