So, I already found code that lets me detect wether a player has an achievement or not. I used Minecraft.getMinecraft().thePlayer.getStatFileWriter.hasAcheivementUnlocked(LostSouls.getAngel);
This is supposed to check if the player has this achieve, and if they have a certain item in their inventory, then take that item and replace it with another item. There are two instances I check for, one if you have the angel achieve and one if you have the demon achieve. If you have the demon one, it takes angel items and replaces them with a different item. Same for the angel achieve but with demon items instead. It is also supposed to cancel getting the other achieve. While this works great in single player, in multiplayer it goes haywire. Whilst testing the mod in multiplayer with a friend, I tried to get the demon achieve and everything was well- until my friend went for the angel achieve. Not only did this result in the replacement of my items as if I had the angel achieve, which is bad enough, and when I tried to place angel items in my inventory they were also replaced, which is supposed to happen as I had the demon achieve, but I got the angel achieve when I did so. That is not supposed to happen. I suspect the error is in the fact that thePlayer is EntityPlayerSP, but I don't know another way to detect achievements. Can anyone help?
Code: