Insane96MCP Posted January 18, 2018 Posted January 18, 2018 I have two prints for the player tags in LivingUpdate and LivingHurt @SubscribeEvent public static void EventLivingHurt(LivingHurtEvent event) { if (event.getEntityLiving() instanceof EntityPlayer){ System.out.println("LivingHurt: " + event.getEntityLiving().getEntityData()); } } @SubscribeEvent public static void EventLivingUpdate(LivingUpdateEvent event) { if (event.getEntityLiving() instanceof EntityPlayer){ System.out.println("LivingUpdate: " + event.getEntityLiving().getEntityData()); } } One returns a set of tags, the other one, one other set. Quote
Insane96MCP Posted January 18, 2018 Author Posted January 18, 2018 26 minutes ago, diesieben07 said: 27 minutes ago, diesieben07 said: Don't use getEntityData. What should I use? Quote
jabelar Posted January 18, 2018 Posted January 18, 2018 1 hour ago, Insane96MCP said: What should I use? What are you trying to achieve? Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
Insane96MCP Posted January 18, 2018 Author Posted January 18, 2018 Saving some timers, a "weight" value for the player. Quote
Insane96MCP Posted January 18, 2018 Author Posted January 18, 2018 5 hours ago, diesieben07 said: You get two, because one is the server and one is the client. I mean one for each event Quote
Draco18s Posted January 18, 2018 Posted January 18, 2018 4 minutes ago, Insane96MCP said: Saving some timers, a "weight" value for the player. Use Capabilities. And EntityData was never intended for mods to store their own data in anyway. Quote 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.
Draco18s Posted January 18, 2018 Posted January 18, 2018 8 minutes ago, diesieben07 said: Yes, it was. It's the precursor to IExtendedEntityProperties, which is now superseded by capabilities. My mistake. Quote 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.
Insane96MCP Posted January 18, 2018 Author Posted January 18, 2018 1 hour ago, Draco18s said: Use Capabilities. And EntityData was never intended for mods to store their own data in anyway. Wow, capabilities are pretty useful BUT, the problem still persist. In LivingHurtEvent I set an int and if I read it in LivingUpdateEvent it always reads 0. You can check the code for living hurt here where I set the damageSlownessDuration And here when I get the damageSlownessDuration. Quote
Insane96MCP Posted January 18, 2018 Author Posted January 18, 2018 3 minutes ago, diesieben07 said: Make sure you read and write the data on the server. Didn't check anywhere if client or server so it should write it in both Quote
Insane96MCP Posted January 19, 2018 Author Posted January 19, 2018 11 hours ago, diesieben07 said: You should only write and read it on the server unless you have a specific reason to. If so, only write it on the server and use packets to send it to the client. Yep, I was writing only on client in the Update. I have misdone the if (world.isRemote) Quote
Recommended Posts
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.