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

[1.12] Getting world time from the server without being passed a world?


Recommended Posts

I'm using nbt tags to create a cooldown for an item I made. It works fine in singleplayer when I was getting the minecraft instance and grabbing the world time from there, but obviously that doesn't work on servers. Is there a simple way I can use server side to get the world an item's holder is in? 

Link to post
Share on other sites
17 minutes ago, naturaGodhead said:

It works fine in singleplayer when I was getting the minecraft instance and grabbing the world time from there, but obviously that doesn't work on servers

Just for reference: This does not work in singleplayer either.

 

17 minutes ago, naturaGodhead said:

Is there a simple way I can use server side to get the world an item's holder is in? 

Every entity has a world reference: Entity#world.

Link to post
Share on other sites
1 minute ago, diesieben07 said:

Just for reference: This does not work in singleplayer either.

 

Every entity has a world reference: Entity#world.

It does work in singleplayer as I've been using it. It's gone this long without being reported because I hadn't used it on a server. How can I get an entity from an item's class?

Link to post
Share on other sites
1 minute ago, naturaGodhead said:

It does work in singleplayer as I've been using it.

No, it does not. It will crash eventually, since you are reaching across logical sides.

 

2 minutes ago, naturaGodhead said:

How can I get an entity from an item's class?

You don't, at least not with a blanket statement like that. Methods that are player-related will get the player passed as a parameter.

Link to post
Share on other sites
2 minutes ago, diesieben07 said:

No, it does not. It will crash eventually, since you are reaching across logical sides.

 

You don't, at least not with a blanket statement like that. Methods that are player-related will get the player passed as a parameter.

"It works" as in it functions without immediately crashing. Obviously I'm trying to fix it, so let's stay on topic. The methods for saving and loading nbt don't accept a player as a parameter, and that's where my issue is, as I need those methods to be completely server side, so I can't grab the world from the client to check the time. 

Link to post
Share on other sites
5 hours ago, naturaGodhead said:

making a couple of methods

oh-really-do-cbffsw.jpg

  • Haha 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to post
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.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Version is 1.12.2-14.23.5.2885   It was working perfectly fine, and the when I tried to use it offline the error happened. Can someone help me fix it? Error.txt
    • i think its the file itself because it not loading there either so i start the game and make a fresh log
    • 20:38:52.071 game at MC-BOOTSTRAP/fmlloader@1.17.1-37.0.5/net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:45) 20:38:52.071 game at MC-BOOTSTRAP/cpw.mods.modlauncher@9.0.7/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) 20:38:52.071 game ... 7 more 20:38:52.071 game Caused by: java.lang.RuntimeException: java.lang.IllegalAccessError: class net.minecraftforge.registries.GameData$ClearableObjectIntIdentityMap tried to access private field net.minecraft.core.IdMapper.f_122654_ (net.minecraftforge.registries.GameData$ClearableObjectIntIdentityMap is in module forge@37.0.5 of loader 'TRANSFORMER' @6bfdb014; net.minecraft.core.IdMapper is in module minecraft@1.17.1 of loader 'TRANSFORMER' @6bfdb014) 20:38:52.071 game at MC-BOOTSTRAP/fmlloader@1.17.1-37.0.5/net.minecraftforge.fml.loading.BackgroundWaiter.runAndTick(BackgroundWaiter.java:43) 20:38:52.071 game at TRANSFORMER/minecraft@1.17.1/net.minecraft.client.main.Main.main(Main.java:125) 20:38:52.071 game ... 13 more 20:38:52.078 game Caused by: java.lang.IllegalAccessError: class net.minecraftforge.registries.GameData$ClearableObjectIntIdentityMap tried to access private field net.minecraft.core.IdMapper.f_122654_ (net.minecraftforge.registries.GameData$ClearableObjectIntIdentityMap is in module forge@37.0.5 of loader 'TRANSFORMER' @6bfdb014; net.minecraft.core.IdMapper is in module minecraft@1.17.1 of loader 'TRANSFORMER' @6bfdb014) 20:38:52.116 game at TRANSFORMER/forge@37.0.5/net.minecraftforge.registries.GameData$ClearableObjectIntIdentityMap.clear(GameData.java:418) 20:38:52.116 game at TRANSFORMER/forge@37.0.5/net.minecraftforge.registries.GameData$BlockCallbacks.onClear(GameData.java:471) 20:38:52.116 game at TRANSFORMER/forge@37.0.5/net.minecraftforge.registries.ForgeRegistry.sync(ForgeRegistry.java:539) 20:38:52.116 game at TRANSFORMER/forge@37.0.5/net.minecraftforge.registries.GameData.loadRegistry(GameData.java:695) 20:38:52.116 game at TRANSFORMER/forge@37.0.5/net.minecraftforge.registries.GameData.vanillaSnapshot(GameData.java:269) 20:38:52.117 game at TRANSFORMER/minecraft@1.17.1/net.minecraft.server.Bootstrap.m_135870_(Bootstrap.java:53) 20:38:52.117 game at TRANSFORMER/minecraft@1.17.1/net.minecraft.client.main.Main.lambda$main$0(Main.java:125) 20:38:52.117 game at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) 20:38:52.117 game at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) 20:38:52.117 game at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) 20:38:52.117 game at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) 20:38:52.117 game at java.base/java.lang.Thread.run(Thread.java:831) 20:38:54.572 monitor Process Monitor Process crashed with exit code 1
    • Thanks for your replies. I guess the best thing to do would be to wait a bit until the Forge version of WorldEdit for 1.17.1 is released. 
    • So when i download forge, i dont know what i did wrong, but its converted into win rar instead of the actual setup, i dont know how to fix it and i would like some help!'  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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