customrealms / core

Core library for the CustomRealms runtime
https://customrealms.io/core
MIT License
37 stars 14 forks source link

Error in code? #18

Closed Selvoid closed 2 years ago

Selvoid commented 2 years ago

Hello I just watched your stream and when I jumped into developing my own plugin, I noticed this error in my code:

ServerEvents.register(EntityDamageByEntityEvent, event => {
    const damager = event.getDamager();
    if (!damager) return;
    if (damager.getType() !== EntityType.PLAYER) return;

    damager.getWorld().strikeLightning(event.getEntity());
})

I was trying to make it when you hit an entity using the EntityDamageByEntityEvent lightning would strike it. But in fact I kept on getting a red underline (error?) under "(event.getEntity());" at the end of the code.