Posted March 5, 201411 yr I just wondered how I can store an integer and save it to the player using nbts I have done some searching, but couldn't find a way to do it. I am quite new to the the whole 1.7.2 thing and haven't modded minecraft for a bit. It will be used like a mana type system and I want it to work in multiplayer as well as singleplayer. Thanks in advance.
March 5, 201411 yr I had exactly the same problem some time ago. Look here: http://www.minecraftforge.net/forum/index.php/topic,10567.msg53494.html#msg53494 Its actually for 1.6.4 but it should work except from the fact that some names might have changed. http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
March 5, 201411 yr Author I am not really to familiar with the events in forge so how would I go at adding them in 1.7.2, it seems to have changed a bit.
March 5, 201411 yr Note:This Works in 1.6.4, I don't know about 1.7.2 If you want to store NBT Data then you can try this: method(EntityPlayer player) { player.getEntityData().setInteger("IntegerName", 1); int i = player.getInteger("IntegerName"); if(player.getEntityData().hasKey("IntegerName")) { do stuff } You can then add anything you want after the getEntityData(). Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!
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.