Posted July 24, 20187 yr 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?
July 24, 20187 yr Author 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?
July 24, 20187 yr Author 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.
July 24, 20187 yr Author I wound up fixing it by making a couple of methods to call from the right click method. Thank you for the help
July 25, 20187 yr 5 hours ago, naturaGodhead said: making a couple of methods 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.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.