GlowstoneMC / Glowstone-Legacy

An open-source server for the Bukkit Minecraft modding interface
Other
363 stars 121 forks source link

Updated GlowLightningStrike to damage living entities and ignite them... (Fixes #203) #637

Closed zachoooo closed 7 years ago

zachoooo commented 9 years ago

based off of their distance to the strike. Damage in minecraft for lightning strikes is consistent and is set to 5 hearts. Damage distance, ignition distance, and ignition period are approximate.

gdude2002 commented 9 years ago

I'm not sure I understand your comment about vanilla; does this PR match vanilla behavior?

zachoooo commented 9 years ago

The damage matches vanilla behavior, I couldn't find values online for the correct distances or ignition period.

PaulBGD commented 9 years ago

"Lightning striking on or near the player will do 5 (Heart.svgHeart.svgHalf Heart.svg) damage, which can be reduced with armor (enchanted or not). Lightning strikes on the player are very rare, and only occur during thunderstorms. Mobs/players that get hit by lightning will be set on fire, but will be quickly put out from the rain during a thunderstorm."

From http://minecraft.gamepedia.com/Damage#Lightning_damage

zachoooo commented 9 years ago

Oh I see, I just need to update it to take armor into account.

Tonodus commented 9 years ago

You can easily use Location#distanceSquared to increase performance.

zachoooo commented 9 years ago

@Tonodus They aren't technically needed, just a good comment explaining the squared-ness of the values.