Ajneb97 / ConditionalEvents

MIT License
22 stars 12 forks source link

Suggestion: variable to check if player under the sky #12

Closed Fenix5fire closed 1 year ago

Fenix5fire commented 1 year ago

It's very hard to check if there is no blocks between player and the sky.

It's possible to get it by checking every single block for air above the player or by using Block method [getLightFromSky](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Block.html#getLightFromSky())(), but to use it in repetitive event you need to use Spigot's PlayerMoveEvent which gonna be executed 20 times per second which is a lot.

This variable could be useable for checking if player is under the clear sky or if he actually affected by rain and possibly different uses

Jonhy188 commented 1 year ago

yes, it would be a very useful variable.

Ajneb97 commented 1 year ago

Doesn't PlaceholderAPI provides a variable like this?

Jonhy188 commented 1 year ago

I only found the variable %player_block_underneath% for the block below the player, but I didn't find one that tells you which block is above the player.

Ajneb97 commented 1 year ago

Added in the latest version.