Jump to content

grexter

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by grexter

  1. Nice idea. Thank you very much.
  2. I made a chewing gum for my mod. It's not getting used up when you eat it. I wanted to introduce a chance that it's randomly swallowed. I tried using java.util.Random#nextInt and it seemed to work fine until I noticed the stacksize and burp sounds glitching. I'm assuming the random number on the client is not the same as on the server. Here's my code: public class ChewedGum extends ItemFood { private static final int CHANCE_SWALLOW_ONE_OF = 3; ... @Override @Nullable public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving) { if (entityLiving instanceof EntityPlayer){ EntityPlayer player = (EntityPlayer)entityLiving; if(new Random().nextInt(CHANCE_SWALLOW_ONE_OF) == 0) { --stack.stackSize; worldIn.playSound((EntityPlayer)null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_PLAYER_BURP, SoundCategory.PLAYERS, 0.5F, worldIn.rand.nextFloat() * 0.1F + 0.9F); } } return stack; } ... } Is there a way to get the same random number on both ends?
  3. I'm having similar issues with a bunch of other 1.10.2 mods (cofhcore, codechickencore, jei - all downloaded from trustworthy sites), the only one I got running so far is hwyla. I also found, that the mcp conf directory for the deobfuscator doesn't exist on my computer for 1.10.2. Please help.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.