Posted May 6, 20178 yr Hey, i am making a loot block that on right click gets removed and spawns a random item with a probability. this is what i have so far: @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { EntityItem item = new EntityItem(worldIn, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(ModTools.hardenedsharpstick, 1)); worldIn.spawnEntity(item); worldIn.destroyBlock(pos, false); return true; } } i want to replace the modtools.hardenedsharpstick with a random item from a list, i tried to make a arraylist but i dont know how to make this for items.
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.