public class SmokeBombItem extends Item { public SmokeBombItem(Properties pProperties) { super(pProperties); } @Override public InteractionResultHolder<ItemStack> use(Level pLevel, Player pPlayer, InteractionHand pUsedHand) { MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); ArrayList<EntityType<Player>> list = Lists.newArrayList(server.getPlayerList().getPlayers()); for (EntityType<Player> playerIn : list) //for each player in the player list { pPlayer.addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 300)); } return super.use(pLevel, pPlayer, pUsedHand); } }
Any ideas on how to fix this code?