Posted January 18, 201510 yr I can get my item to drop but I'm trying to make the item rare and not drop all the time. Here's my code, what should I do to make the drop happen, say 5% of the time * the level of Looting? http://pastebin.com/LhYsypKX
January 18, 201510 yr 5% -> Random(20) == 0. 5% * Looting -> Random(20) <= Looting Mathemagic Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
January 18, 201510 yr You also have to make sure that you actually reference the looting level stored in the event, not just your level, which is just initiated at 0. so you would have something like Random rand = new Random(); // since there is none supplied if(rand.nextInt(20) == 0 && event.lootingLevel > 0) { event.entityLiving.dropItem(My_Items.SuperRareEgg, event.lootingLevel); }
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.