Artificial light

Hello, i know i’m not a light (french expression) but i wan’t to create a light who move with the player, i want the light invisible and unbreakable (and the player can cross it)

do you have any idea?.

The only way I could think of doing this is placing a torch on whatever block the player is standing on/next to. It would be fairly invisible (being in the player), but dynamic lighting is nearly impossible in Minecraft, and the light may not even update fast enough.

oki thx
i understand

You can get these values

Optional<GroundLuminanceProperty> ground = event.getTargetBlock().getProperty(GroundLuminanceProperty.class);
Optional<SkyLuminanceProperty> sky = event.getTargetBlock().getProperty(SkyLuminanceProperty.class);

Although that is true, you can’t set them, which would be quite helpful.

I didn’t know you couldn’t set them.

and with the function getOrCreate, i can’t? (i understand, i juste try)

Data API is for setting things, Property API is for obtaining static information. The reason you can’t set light is because it’s all calculated Client side.


What i used to do was create floating torches

Place barrier block

torch on barrier block

boom floating torch.

Most newer players will ask

‘OMG how did u do that u haxor’


1 Like

can i create a torch who follow the player? do i have to modify the torch on any move?

Good question, that i dont have the anwser to

I mean with cmd blocks im sure there is a way, but not that i know of im afraid

Sorry :stuck_out_tongue:

What I used to do (programmatically) is use the end portal block, which gives off the max light level and is invisible from below. I would then deny the end teleport when they walked through any that my plugin spawned.

1 Like

As others have said, you’re unfortunately pretty limited in what kinds of lighting you can do server-side. Whatever method you choose will be limited to setting a block. Finer-grained resolution (e.g. moving the light source within a block), is unfortunately not possible.

1 Like