Originally Posted by
Luke132
because you havent put in any code to add the item....?
Code:
Random random = new Random();
Item item = commonRewardsI[random.nextInt()];
item.setAmount(random.nextInt(item.getAmount());
player.getInventory().addItem(item);
This is the code i've entered to add the item but when i click the chest, no item is given, i've also tried the other solution of
Code:
Random random = new Random();
Item item = commonRewardsI[random.nextInt(commonRewardsI)];
item.setAmount(random.nextInt(item.getAmount());
player.getInventory().addItem(item);
But this gives me an error if you check the reply above your comment you'd see.