diff --git a/src/main/java/org/spongepowered/common/data/provider/entity/MobData.java b/src/main/java/org/spongepowered/common/data/provider/entity/MobData.java index 87b3b5cca09..238408bd55d 100644 --- a/src/main/java/org/spongepowered/common/data/provider/entity/MobData.java +++ b/src/main/java/org/spongepowered/common/data/provider/entity/MobData.java @@ -48,7 +48,13 @@ public static void register(final DataProviderRegistrator registrator) { .set((h, v) -> h.setLeftHanded(v.equals(HandPreferences.LEFT.get()))) .create(Keys.LEASH_HOLDER) .get(h -> ((Entity) h.getLeashHolder())) - .set((h, v) -> h.setLeashedTo((net.minecraft.world.entity.Entity) v, true)) + .set((h, v) -> { + if (v == null) { + h.dropLeash(true, false); + } else { + h.setLeashedTo((net.minecraft.world.entity.Entity) v, true); + } + }) .create(Keys.TARGET_ENTITY) .get(h -> (Living) h.getTarget()) .setAnd((h, v) -> {