Replacing mc.currentScreen crashes the game
Unsolved
ScriptAPI
-
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