Replacing mc.currentScreen crashes the game
-
bad script
/// api_version=2 var script = registerScript({ name: "EpicFail", version: "2.0", authors: ["OrangeCat", "Katchum"] }); var prf = ", "+script.scriptName + " v"+script.scriptVersion+ " by"; Java.type("java.util.Arrays").asList(script.scriptAuthors).forEach(function(e){ prf += (e != script.scriptAuthors[0] ? ", " : " ") + e; }); script.registerModule({ name: script.scriptName, description: "tf" + prf, category: "Movement", tag: "sigma" }, function (module) { var GuiChest = Java.type("net.minecraft.client.gui.inventory.GuiChest"); var ContainerChest = Java.type("net.minecraft.inventory.ContainerChest"); var IInventory = Java.type("net.minecraft.inventory.IInventory"); module.on("update", function(e){ var cr = mc.currentScreen; var cry = mc.thePlayer.openContainer; if(cr != null && cr instanceof GuiChest){ // i fucking hate js var i = cr.lowerChestInventory; if(i instanceof IInventory){ // tf is this // get actual inventory is my method in java client, figure out how to get the correct inventory var rp = new (Java.extend(GuiChest))(mc.thePlayer.getActualInventory(), i){ drawScreen: function(mouseX, mouseY, partialTicks){ Chat.print("i forgor :skull:") } }; var sc = mc.class.getDeclaredField("currentScreen"); sc.setAccessible(true); sc.set(mc, rp); } } }); });here is the stack trace thing:

aparently it makes the player null
-
bad script
/// api_version=2 var script = registerScript({ name: "EpicFail", version: "2.0", authors: ["OrangeCat", "Katchum"] }); var prf = ", "+script.scriptName + " v"+script.scriptVersion+ " by"; Java.type("java.util.Arrays").asList(script.scriptAuthors).forEach(function(e){ prf += (e != script.scriptAuthors[0] ? ", " : " ") + e; }); script.registerModule({ name: script.scriptName, description: "tf" + prf, category: "Movement", tag: "sigma" }, function (module) { var GuiChest = Java.type("net.minecraft.client.gui.inventory.GuiChest"); var ContainerChest = Java.type("net.minecraft.inventory.ContainerChest"); var IInventory = Java.type("net.minecraft.inventory.IInventory"); module.on("update", function(e){ var cr = mc.currentScreen; var cry = mc.thePlayer.openContainer; if(cr != null && cr instanceof GuiChest){ // i fucking hate js var i = cr.lowerChestInventory; if(i instanceof IInventory){ // tf is this // get actual inventory is my method in java client, figure out how to get the correct inventory var rp = new (Java.extend(GuiChest))(mc.thePlayer.getActualInventory(), i){ drawScreen: function(mouseX, mouseY, partialTicks){ Chat.print("i forgor :skull:") } }; var sc = mc.class.getDeclaredField("currentScreen"); sc.setAccessible(true); sc.set(mc, rp); } } }); });here is the stack trace thing:

aparently it makes the player null
@skiddermaster412 you didn't use displayGuiScren method
-
i forgor

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login