#-
1 messages · Page 1 of 1 (latest)
hey hey, trying to figure out client sided blocks at the moment.
I have a very complicated and messy flashlight plugin set up, basically it places light blocks where you look in certain distances ( adjustable and stuff )
basically, i wanted to switch from placing real lightblocks to fake client-side lightblocks to everyone.
This is how i tried:
Instead of
lightblock.setType(Material.LIGHT); // place new lightblock at new location
I used
for(Player lp : Bukkit.getServer().getOnlinePlayers()){
lp.sendBlockChange(lightblock.getLocation(), Material.LIGHT.createBlockData());
}
Creation of this lightblock works, but when i want to remove it again using the same method like this it doesn't work:
Instead of
prevsafety.getBlock().setType(Material.AIR); // remove lightblock
I used
for(Player lp : Bukkit.getServer().getOnlinePlayers()){
lp.sendBlockChange(prevsafety, Material.AIR.createBlockData());
}```
Issue is, it works when just setting it to air in normal blocks, but when i do it client-sided with sendBlockChange it doesn't remove the lightblock
to sum it up: sendBlockChange for setting a client sided lightblock works, but when i want to remove it (place air over it) it doesn't work
does anyone know why it might not work? I haven't found anything in spigot docs, nor after googling for hours at a time
idk why that wouldn't work, but as a work around you might be able to send blockdata of a light with 0 for its level
how would i do that, and what do you mean by level?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/data/type/Light.html
Light implements Levelled
you can set the light level of light blocks
*extends
okay, but i still want it to emmit light
you want it to emit light when removing it?