diff --git a/Lobby/src/main/java/de/fanta/lobby/Lobby.java b/Lobby/src/main/java/de/fanta/lobby/Lobby.java index cfc414a..67b535d 100644 --- a/Lobby/src/main/java/de/fanta/lobby/Lobby.java +++ b/Lobby/src/main/java/de/fanta/lobby/Lobby.java @@ -394,6 +394,12 @@ onlineBlock.setBlockData(rotatable); } } + + if (piglin.isLeashed()) { + Entity entity = piglin.getLeashHolder(); + piglin.setLeashHolder(null); + entity.remove(); + } } if (nmsUtils != null) { nmsUtils.getEntityUtils().setPiglinDancing(piglin, true); @@ -434,6 +440,13 @@ offlineBlock.setBlockData(rotatable); } } + + Location fenceLocation = hangableData.getFenceLocation(); + if (fenceLocation != null && !piglin.isLeashed()) { + Entity leashKnot = fenceLocation.getWorld().spawnEntity(fenceLocation, EntityType.LEASH_KNOT); + leashKnot.setPersistent(false); + piglin.setLeashHolder(leashKnot); + } } } case RUNNING -> {