You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -76,9 +76,14 @@ public static Entity teleport(Entity entity, int newDimension, double x, double
76
76
if (entityinstanceofEntityPlayerMP) {
77
77
EntityPlayerMPplayer = (EntityPlayerMP) entity;
78
78
try {
79
-
FieldinvulnerableDimensionChange = EntityPlayerMP.class.getDeclaredField("invulnerableDimensionChange"); // Prevents cancelling the position change in survival.
79
+
FieldinvulnerableDimensionChange;
80
+
try {
81
+
invulnerableDimensionChange = EntityPlayerMP.class.getDeclaredField("field_184851_cj"); // If this breaks, check that Minecraft didn't rename the field
82
+
} catch (NoSuchFieldExceptione) { // Running on deobfuscated Minecraft
invulnerableDimensionChange.setBoolean(player, true); // without this, there's a chance that the new player position gets cancelled
86
+
invulnerableDimensionChange.setBoolean(player, true); // Prevent Minecraft from cancelling the position change being too big if the player is not in creative
0 commit comments