Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

1.14.4 GUI without container or tileentity


Daniel Rollins
 Share

Recommended Posts

Hi,

I have a GUI that extends Screen. It is similar to how a writable_book works. There is not a container and no tileentity. The Gui pulls data from NBT from the Item and uses a network handler to send the data to the server.

 

The Gui comes up from an Item by using onItemRightClick. I currently call it from that function like this: Minecraft.getInstance().displayGuiScreen(new MyGuiScreen(playerIn, itemstack, handIn)); That has been working fine until I put my mod on a Dedicated Server and got this error at startup: "Attempted to load class net/minecraft/client/gui/screen/Screen for invalid dist DEDICATED_SERVER". How do I call my Gui properly in 1.14.4 so it doesn't crash the server? I saw some posts that suggested other things like NetworkHooks but those all seemed to require tile entities or containers.

 

Thank you for your help.

Edited by Daniel Rollins
Link to comment
Share on other sites

21 minutes ago, Daniel Rollins said:

Minecraft.getInstance().displayGuiScreen(new MyGuiScreen(playerIn, itemstack, handIn));

You cant access client only code on the server. Use your proxy setup to run this.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

The Screen class you're using is trying to run on the server i'm guessing. Calling it from your client proxy should fix it.

MyScreenObjects Class:

public class MyScreenObjects{
	@ObjectHolder("modid:myobjectholder")
	public static ContainerType<ModContainer> ModContainerScreen;
}

ClientProxy: (IMCOMPLETE PROXY CLASS) You can find a tutorial somewhere on how to set it up right if you don't already have one.

public class ClientProxy implements ProxyInterface{

    @Override
    public void init() {
   		ScreenManager.registerFactory(MyScreenObjects.ModContainerScreen, MyModScreenClass::new);
    }

}

*called in your main class

Link to comment
Share on other sites

3 hours ago, max2461 said:

The Screen class you're using is trying to run on the server i'm guessing. Calling it from your client proxy should fix it.

MyScreenObjects Class:

ClientProxy: (IMCOMPLETE PROXY CLASS) You can find a tutorial somewhere on how to set it up right if you don't already have one.

*called in your main class

That is the registering of the GUI. OP is having problem with opening the GUI.

 

3 hours ago, Animefan8888 said:

You cant access client only code on the server. Use your proxy setup to run this.

Since the OP is calling the code from Item#onItemRightClick, I would suggest to handle the right click on the server side, then sends a packet to the client to open the GUI. This allows the server to control if the GUI should be opened.

Actually, since the OP is trying to create a book-like GUI about which the server does not care, opening it directly on the client-side should be fine.

Edited by DavidM

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • The Chunk#isLoaded seems to be depreciated, nor is there a ChunkLoader#chunkExists (my research)... what's the new way of doing this? The Chunk#loaded field is private, and the Chunk#getStatus method always returns ChunkStatus.FULL... I can get the chunk with entity.level.getChunk(entity.getBlockPosition()), but what then?
    • 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • I don't really know why, if someone could give me a hand and let me know what's wrong that would be great. Cheers   ---- Minecraft Crash Report ---- WARNING: coremods are present:   Inventory Tweaks Coremod (InventoryTweaks-1.63.jar)   MovingWorldCore (movingworld-1.12-6.353-full.jar)   Quark Plugin (Quark-r1.6-179.jar)   IvToolkit (IvToolkit-1.3.3-1.12.jar)   weaponlib (mw_2.0-0.4.4.6_mc1.12.2.jar)   ApotheosisCore (Apotheosis-1.12.2-1.12.5.jar) Contact their authors BEFORE contacting forge // Don't do that. Time: 9/29/21 4:48 AM Description: Initializing game java.lang.NoClassDefFoundError: net/minecraftforge/fml/common/registry/IForgeRegistryEntry     at java.lang.Class.forName0(Native Method)     at java.lang.Class.forName(Class.java:348)     at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:539)     at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)     at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136)     at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:595)     at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232)     at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:467)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)     at net.minecraft.client.main.Main.main(SourceFile:123)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.ClassNotFoundException: net.minecraftforge.fml.common.registry.IForgeRegistryEntry     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     ... 38 more Caused by: java.lang.NullPointerException A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace:     at java.lang.Class.forName0(Native Method)     at java.lang.Class.forName(Class.java:348)     at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:539)     at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)     at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136)     at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:595)     at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232)     at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:467) -- Initialization -- Details: Stacktrace:     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)     at net.minecraft.client.main.Main.main(SourceFile:123)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) -- System Details -- Details:     Minecraft Version: 1.12.2     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 226393024 bytes (215 MB) / 536870912 bytes (512 MB) up to 2147483648 bytes (2048 MB)     JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     FML: MCP 9.42 Powered by Forge 14.23.5.2855 Optifine OptiFine_1.12.2_HD_U_G5 47 mods loaded, 47 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     | State | ID                                           | Version                  | Source                                             | Signature                                |     |:----- |:-------------------------------------------- |:------------------------ |:-------------------------------------------------- |:---------------------------------------- |     | LC    | minecraft                                    | 1.12.2                   | minecraft.jar                                      | None                                     |     | LC    | mcp                                          | 9.42                     | minecraft.jar                                      | None                                     |     | LC    | FML                                          | 8.0.99.99                | forge-1.12.2-14.23.5.2855.jar                      | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LC    | forge                                        | 14.23.5.2855             | forge-1.12.2-14.23.5.2855.jar                      | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LC    | ivtoolkit                                    | 1.3.3-1.12               | minecraft.jar                                      | None                                     |     | LC    | com.elytradev.movingworld.common.asm.coremod |                          | minecraft.jar                                      | None                                     |     | LC    | biomesoplenty                                | 7.0.1.2444               | BiomesOPlenty-1.12.2-7.0.1.2444-universal.jar      | None                                     |     | LC    | craftstudioapi                               | 1.0.0                    | CraftStudio-1.0.0.93-mc1.12-alpha.jar              | None                                     |     | LC    | animania                                     | 2.0.3.28                 | animania-1.12.2-base-2.0.3.28.jar                  | None                                     |     | LC    | placebo                                      | 1.6.0                    | Placebo-1.12.2-1.6.0.jar                           | None                                     |     | LC    | apotheosis                                   | 1.12.4                   | Apotheosis-1.12.2-1.12.5.jar                       | None                                     |     | LC    | jei                                          | 4.16.1.301               | jei_1.12.2-4.16.1.301.jar                          | None                                     |     | LC    | quark                                        | r1.6-179                 | Quark-r1.6-179.jar                                 | None                                     |     | LC    | autoreglib                                   | 1.3-32                   | AutoRegLib-1.3-32.jar                              | None                                     |     | LC    | codechickenlib                               | 3.2.3.358                | CodeChickenLib-1.12.2-3.2.3.358-universal.jar      | f1850c39b2516232a2108a7bd84d1cb5df93b261 |     | LC    | redstoneflux                                 | 2.1.1                    | Redstone-Flux-API-1.12.2.jar                       | None                                     |     | LC    | brandonscore                                 | 2.4.20                   | BrandonsCore-1.12.2-2.4.20.162-universal.jar       | None                                     |     | LC    | controlling                                  | 3.0.10                   | Controlling-3.0.10.jar                             | None                                     |     | LC    | craft_gunpowder_11                           | 1.1.0                    | CraftableGunpowder_1-1.jar                         | None                                     |     | LC    | cucumber                                     | 1.1.3                    | Cucumber-1.12.2-1.1.3.jar                          | None                                     |     | LC    | movingworld                                  | 1.12-6.353               | movingworld-1.12-6.353-full.jar                    | None                                     |     | LC    | davincisvessels                              | @DVESSELSVER@            | davincisvessels-1.12-6.340-full.jar                | None                                     |     | LC    | ptrmodellib                                  | 1.0.5                    | PTRLib-1.0.5.jar                                   | None                                     |     | LC    | props                                        | 2.6.3.7                  | Decocraft-2.6.3.7_1.12.2.jar                       | None                                     |     | LC    | draconicevolution                            | 2.3.28                   | Draconic-Evolution-1.12.2-2.3.28.354-universal.jar | None                                     |     | LC    | reccomplex                                   | 1.4.8.2                  | RecurrentComplex-1.4.8.2.jar                       | None                                     |     | LC    | dynamictrees                                 | 1.12.2-0.9.25            | DynamicTrees-1.12.2-0.9.25.jar                     | None                                     |     | LC    | ftblib                                       | 5.4.7.2                  | FTBLib-5.4.7.2.jar                                 | None                                     |     | LC    | itemfilters                                  | 1.0.4.2                  | ItemFilters-1.0.4.2.jar                            | None                                     |     | LC    | ftbquests                                    | 1202.9.0.15              | FTBQuests-1202.9.0.15.jar                          | None                                     |     | LC    | cfm                                          | 6.3.1                    | furniture-6.3.1-1.12.2.jar                         | None                                     |     | LC    | gravestone                                   | 1.10.3                   | gravestone-1.10.3.jar                              | None                                     |     | LC    | waila                                        | 1.8.26                   | Hwyla-1.8.26-B41_1.12.2.jar                        | None                                     |     | LC    | inventorytweaks                              | 1.63+release.109.220f184 | InventoryTweaks-1.63.jar                           | 55d2cd4f5f0961410bf7b91ef6c6bf00a766dcbe |     | LC    | journeymap                                   | 1.12.2-5.7.1             | journeymap-1.12.2-5.7.1.jar                        | None                                     |     | LC    | numina                                       | 1.12.2-1.0.38            | Numina-1.12.2-1.0.38.jar                           | None                                     |     | LC    | refinedstorage                               | 1.6.15                   | refinedstorage-1.6.15.jar                          | 57893d5b90a7336e8c63fe1c1e1ce472c3d59578 |     | LC    | powersuits                                   | 1.12.2-1.0.46            | ModularPowersuits-1.12.2-1.0.46.jar                | None                                     |     | LC    | mw                                           | 0.4.4.6                  | mw_2.0-0.4.4.6_mc1.12.2.jar                        | None                                     |     | LC    | mysticalagriculture                          | 1.7.5                    | MysticalAgriculture-1.12.2-1.7.5.jar               | None                                     |     | LC    | mysticalagradditions                         | 1.3.2                    | MysticalAgradditions-1.12.2-1.3.2.jar              | None                                     |     | LC    | roguelike                                    | 1.8.0                    | RoguelikeDungeons-1.12.2-1.8.0.jar                 | None                                     |     | LC    | solarflux                                    | 12.4.11                  | SolarFluxReborn-1.12.2-12.4.11.jar                 | 9f5e2a811a8332a842b34f6967b7db0ac4f24856 |     | LC    | mo                                           | 1.0                      | sulfur-potassium-1.12-1.1.jar                      | None                                     |     | LC    | tektopia                                     | 1.1.0                    | tektopia-1.1.0.jar                                 | None                                     |     | L     | waystones                                    | 4.0.4                    | Waystones_1.12-4.0.4.jar                           | None                                     |     | L     | worldedit                                    | 6.1.10                   | worldedit-forge-mc1.12.2-6.1.10-dist.jar           | None                                     |     Loaded coremods (and transformers):  Inventory Tweaks Coremod (InventoryTweaks-1.63.jar)   invtweaks.forge.asm.ContainerTransformer MovingWorldCore (movingworld-1.12-6.353-full.jar)    Quark Plugin (Quark-r1.6-179.jar)   vazkii.quark.base.asm.ClassTransformer IvToolkit (IvToolkit-1.3.3-1.12.jar)    weaponlib (mw_2.0-0.4.4.6_mc1.12.2.jar)   com.vicmatskiv.weaponlib.core.WeaponlibClassTransformer ApotheosisCore (Apotheosis-1.12.2-1.12.5.jar)   shadows.ApotheosisTransformer     GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 471.96' Renderer: 'NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2'     Launched Version: 1.12.2-forge-14.23.5.2855     LWJGL: 2.9.4     OpenGL: NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2 GL version 4.6.0 NVIDIA 471.96, NVIDIA Corporation     GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported.     Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'fml,forge'     Type: Client (map_client.txt)     Resource Packs:      Current Language: English (US)     Profiler Position: N/A (disabled)     CPU: 20x Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz     OptiFine Version: OptiFine_1.12.2_HD_U_G5     OptiFine Build: 20210124-142939     Render Distance Chunks: 8     Mipmaps: 4     Anisotropic Filtering: 1     Antialiasing: 0     Multitexture: false     Shaders: SEUS-Renewed-v1.0.1.zip     OpenGlVersion: 4.6.0 NVIDIA 471.96     OpenGlRenderer: NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2     OpenGlVendor: NVIDIA Corporation     CpuCount: 20
    • 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • so uh, i created a forge server to run on my pc, and followed a lot of steps seeing other threads, and trying them, but the mods folder is not appearing, and the vanilla server keeps appearing as vanilla, i de-installed and installed several times
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.