I've made a few changes and added a position for the bolt, but the lightning bolt is still not being rendered. The effects are taking place for example, the player takes damage and catches on fire, the sky blinks and sound effects still play but the lightning just doesn't appear. I've also added a cooldown time for fun (just to learn more methods).
@Override
public InteractionResultHolder<ItemStack> use(Level world, Player player, InteractionHand hand) {
LightningBolt lightningBolt = EntityType.LIGHTNING_BOLT.create(world);
if(!world.isClientSide) {
world.addFreshEntity(lightningBolt);
lightningBolt.moveTo(player.position());
player.getCooldowns().addCooldown(this, 100);
}
return super.use(world, player, hand);
}