Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player)
- {
- if(!worldIn.isRemote)
- {
- switch(type)
- {
- case RAW: mysteryMeat(worldIn, player);
- break;
- case FROZEN: carpaccio(stack, worldIn, player);
- break;
- default: //Nothing yet ;)
- break;
- }
- }
- }
- //currently crashes
- private void mysteryMeat(World worldIn, EntityPlayer player)
- {
- int effect = rng.nextInt(5);
- switch(effect)
- {
- case 0: player.setFire(8);
- break;
- case 1: player.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 100, 1));
- break;
- case 2: player.addPotionEffect(new PotionEffect(MobEffects.POISON, 100, 1));
- break;
- case 3: player.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 100, 10));
- break;
- case 4: //nothing
- break;
- }
- }
- //currently crashes
- private void carpaccio(ItemStack stack, World worldIn, EntityPlayer player)
- {
- int effect = rng.nextInt(5);
- switch(effect)
- {
- case 0: player.curePotionEffects(stack);
- break;
- case 1: player.addPotionEffect(new PotionEffect(MobEffects.INVISIBILITY, 150, 1));
- break;
- case 2: player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 50, 5));
- break;
- case 3: player.addPotionEffect(new PotionEffect(MobEffects.INSTANT_HEALTH, 100, 10));
- break;
- case 4: //nothing
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment