Light Api Plugin

Light API Plugin (1.19.4, 1.19.2) is a plugin that allows you to Edit light resource levels in Minecraft. It works with CraftBukkit, Spigot, and Paper servers and supports versions from 1.8 to 1.19. With LightAPI, you can create dynamic and realistic lighting effects for your maps, minigames, and plugins.

Light API Plugin (1.19.4, 1.19.2) - Bukkit, Spigot, Paper 1

Features:

  •  Edit light levels in the Minecraft world.

Currently supported platforms:

  • CraftBukkit/Spigot (1.14.1 – 1.19)

Current supported light engines:

  • Vanilla engine (1.14.1 – 1.19)
  • Starlight engine (1.17.1 – 1.19)

How to use:

  • Very simple.
  • If you want to edit light level (with deferred policy):

Code (Text):

LightAPI.get().setLightLevel(String worldName, int blockX, int blockY, int blockZ, int lightLevel)

After calling this function, your request is added to the queue and will be executed after a while with automatic sending to all clients (by default, after 1 tick).

If you want more control, you can use:

Code (Text):

LightAPI.get().setLightLevel(String worldName, int blockX, int blockY, int blockZ, int lightLevel, int lightFlags);
LightAPI.get().setLightLevel(String worldName, int blockX, int blockY, int blockZ, int lightLevel, int lightFlags, ICallback callback);
LightAPI.get().setLightLevel(String worldName, int blockX, int blockY, int blockZ, int lightLevel, int lightFlags, EditPolicy editPolicy, SendPolicy sendPolicy, ICallback callback);

Using the following parameters, you can:

  • lightFlags: choose which lighting layer to make changes on, as well as combine them;
  • editPolicy: choose a edit policy (apply changes right now, apply immediately taking into account the state of the server, or apply deferred (by default 1 tick)).
  • sendPolicy: choose a policy for sending lighting data to clients (send separate packets for each change or combine the same chunks within an interval (by default 2 tick)).
  • callback: get execution result codes about completed stages.

If this is not enough for you, then you can use IBukkitExtension to get a Handler class.

Code (Text):

IBukkitExtension ext = (IBukkitExtension) LightAPI.get().getExtension();
IHandler rawHandler = ext.getHandler();

With this class, you get “raw” access to library elements.

Commands:

  • /lightapi – main command

Configuration:

Default configuration:

Code (Text):

general:
debug: false
enable-metrics: true
enable-compatibility-mode: false
force-enable-legacy: false
specific-handler-path: none
handlers:
craftbukkit:
factory-path: ru.beykerykt.minecraft.lightapi.bukkit.internal.handler.craftbukkit.HandlerFactory
BukkitBackgroundService:
corePoolSize: 1
BukkitScheduledChunkObserver:
tick-period: 2
BukkitScheduledLightEngine:
relight-strategy: DEFERRED
tick-period: 1
max-time-ms-in-per-tick: 50
max-iterations-in-per-tick: 256

general:

debug – enables debug messages.
enable-metrics – enables bStats metrics.
enable-compatibility-mode – enables compatibility mode, where instead of editing lighting data, the plugin places blocks of light. Does not support Skylight editing. Works only with 1.17+.
force-enable-legacy – enables support for legacy plugins (from ru.beykerykt.lightapi namespace).
specific-handler-path – the path for forced loading of the handler.
handlers.* – a list of platforms and their paths to the HandlerFactory.

BukkitBackgroundService:
corePoolSize – The number of threads allocated for internal tasks.

BukkitScheduledChunkObserver:
tick-period – The delay in server ticks before queue processing.

BukkitScheduledLightEngine:
relight-strategy – A strategy for recalculating lighting. The values can be as follows: DEFERRED – recalculation is performed after ALL changes are applied. FORWARD – recalculation is performed after EACH change.
tick-period – The delay in server ticks before queue processing.
max-time-ms-in-per-tick – The maximum time (in milliseconds) allocated for processing requests for each tick.
max-iterations-in-per-tick – The maximum number of processed requests per tick.

Example usage:

Code (Java):

int blockLight = LightAPI.get().getLightLevel(worldName, blockX, blockY, blockZ,
LightFlag.BLOCK_LIGHTING);
broadcastMessage("LightLevel: " + blockLight);
int resultCode =
LightAPI.get().setLightLevel(worldName, blockX, blockY, blockZ, lightLevel);
switch (resultCode) {
case ResultCode.SUCCESS:
// The request was executed.
break;
case ResultCode.MOVED_TO_DEFERRED:
// The request has been moved to the queue and will be executed after a
// while.
break;
default:
broadcastMessage("Something is wrong. Result code:" + resultCode);
break;
}

Maven

subproject: lightapi-bukkit-common

Code (Text):

<dependency>
<groupId>com.github.BeYkeRYkt</groupId>
<artifactId>lightapi-bukkit-common</artifactId>
<version>5.1.0</version>
<scope>provided</scope>
</dependency>

How to install:

  • Download a plugin of your choice.
  • Place the .jar and any other files in your plugin’s directory.
  • Run the server and wait for it to fully load.
  • Type stop in your Minecraft server console to bring the server to a clean stop.
  • Run the server.
  • All done! Your plugin should be installed and ready to be used.

Light API Plugin (1.19.4, 1.19.2) Download Links

For All Versions from Minecraft 1.14 to Minecraft 1.19

Download from Server 1 – Download from Server 2

Mods

1.19.4 Mods

1.19.3 Mods

1.19.2 Mods

1.18.2 Mods

1.16.5 Mods

1.15.2 Mods

1.12.2 Mods

1.8.9 Mods

1.7.10 Mods

1.18.1 Mods

1.17.1 Mods

1.14.4 Mods

1.13.2 Mods

1.11.2 Mods

1.10.2 Mods

1.9.4 Mods

Minecraft Modpacks

1.19.4 Modpacks

1.19.3 Modpacks

1.19.2 Modpacks

1.18.2 Modpacks

1.16.5 Modpacks

1.12.2 Modpacks

1.7.10 Modpacks

Forge Mods

Fabric Mods

Quilt Mods

Resource Packs

1.19.4 Resource Packs

1.19.3 Resource Packs

1.19.2 Resource Packs

1.18.2 Resource Packs

1.16.5 Resource Packs

1.15.2 Resource Packs

1.12.2 Resource Packs

1.8.9 Resource Packs

1.7.10 Resource Packs

1.18.1 Resource Packs

1.17.1 Resource Packs

1.14.4 Resource Packs

1.13.2 Resource Packs

1.11.2 Resource Packs

1.10.2 Resource Packs

1.9.4 Resource Packs

Shaders

1.19.4 Shaders

1.19.3 Shaders

1.19.2 Shaders

1.18.2 Shaders

1.17.1 Shaders

1.16.5 Shaders

Maps

1.19.4 Maps

1.19.3 Maps

1.19.2 Maps

1.18.2 Maps

1.16.5 Maps

1.15.2 Maps

1.12.2 Maps

1.8.9 Maps

1.7.10 Maps

1.18.1 Maps

1.17.1 Maps

1.14.4 Maps

1.13.2 Maps

1.11.2 Maps

1.10.2 Maps

1.9.4 Maps

Data Packs

1.19.4 Data Packs

1.19.3 Data Packs

1.19.2 Data Packs

1.18.2 Data Packs

1.16.5 Data Packs

1.15.2 Data Packs

1.18.1 Data Packs

1.17.1 Data Packs

1.14.4 Data Packs

1.13.2 Data Packs

MCPE/Bedrock

Mods & Addons

MCPE 1.19 Add-ons

MCPE 1.19 Mods

Texture Packs

MCPE 1.19 Texture Packs

MCPE 1.19 Resource Packs

Maps

MCPE 1.19 Maps

Clients

MCPE 1.19 Clients

Mod Menu Clients

Shaders

MCPE 1.19 Shaders

Render Dragon Shaders

Launchers

Skin Packs

Clients

1.19.4 Clients

1.19.3 Clients

1.19.2 Clients

1.18.2 Clients

1.16.5 Clients

1.12.2 Clients

1.8.9 Clients

Launchers

1.19.4 Launchers

1.19.3 Launchers

1.19.2 Launchers

1.18.2 Launchers

1.16.5 Launchers

1.12.2 Launchers

1.7.10 Launchers

Seeds

1.19.4 Seeds

1.19.3 Seeds

1.19.2 Seeds

1.18.2 Seeds

Skins

Plugins

Bukkit Plugins

Spigot Plugins

Paper Plugins

Tutorials

Minecraft Skins

Installation Guide

Mobs Wiki Guide

Seeds Wiki Guide

Biomes Wiki Guide

Status Effects Wiki Guide

Enchantments Wiki Guide

Materials Wiki Guide

Command Blocks

Versions

Backlinks