Posted October 20, 201411 yr I've started to use variables to store information about players. Example: if (event.entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entity; if(event.entity.isWet()) { int watersealing = MageniteIngotItem.watersealing; if(watersealing <= 0) { event.entity.attackEntityFrom(DamageSource.drown, 1.0F); } else { --watersealing; MageniteIngotItem.watersealing = watersealing; if(watersealing == 200) { player.addChatMessage(new ChatComponentText("5 Seconds left of WaterSealing.")); } if(watersealing == 50) { player.addChatMessage(new ChatComponentText("1 Second left of WaterSealing!")); } } } However the problem with this code is that it's obviously a global variable that applies to everyone. And I would like each player to have their own value for this variable. What would I need to do make this individual to each player? And what is the best way to store info for this kind of thing? Would I use the player file for this or is there a way to write a file of my own?(I plan on eventually storing a fairly good chunk of info.) I'm not trying to be rude it just comes out that way sometimes. I'm here to try and learn as much as I can, won't you join me?
October 20, 201411 yr It would be shame to rewrite everything when it's alredy there, so I'll just leave link - probably one of best tuts on this. http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-1-7-2-1-6-4-eventhandler-and 1.7.10 is no longer supported by forge, you are on your own.
October 21, 201411 yr Author Thank you that's much appreciated. I'm not trying to be rude it just comes out that way sometimes. I'm here to try and learn as much as I can, won't you join me?
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.