Light of a location

Hello everybody,

I come to you to ask something.

I want to create a vampire! (For a RP) but i want to verify the luminosity of a location.

Do you know how can i do that?


You should be able to retrieve it by getting the LightEmissionProperty from a BlockState or Location.

Location location;
Optional<LightEmissionProperty) property = location.getProperty(LightEmissionProperty.class);
if (property.isPresent()) {
    Integer lightLevel = property.get().getValue();

The same holds true for a BlockState.

thx for help. i’ll try

That’s the amount of light a block generates, not the amount of light a block currently has.

Ah, read this thread too quickly. Seems like `GroundLuminanceProperty is what’s needed.