- Tested Minecraft Versions:
- 1.8
- 1.9
- 1.10
- 1.11
- Source Code:
- https://github.com/BeYkeRYkt/LightAPI
RESOURCE IS INACTIVE! SWITCH TO THIS FORK BY @bottomdumber !
Description:
This small library help you to create an invisible light sources.
Features:
- Create/Delete invisible light source.
Support CraftBukkit implements :
- CraftBukkit/Spigot (1.8.8 - 1.10)
- PaperSpigot (Only 1.8.8)
- Paper (1.9+)
- TacoSpigot (1.9+)
- Cauldron (1.7.10) <Experimental Support>
Basic methods:
- LightAPI
- createLight(World, blockX, blockY, blockZ, lightLevel, async); - Creates light on this location and the level of light. If async state is set to "true", then the request will be created and added to the processing queue.
If you have Location, you can use this:Code (Text):LightAPI.createLight(location.getWorld(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), 15, true);
Code (Text):LightAPI.createLight(location, 15, true);
- deleteLight(World, blockX, blockY, blockZ, async); - delete light on this location. If async state is set to "true", then the request will be created and added to the processing queue.
If you have Location, you can use this:Code (Text):LightAPI.deleteLight(location.getWorld(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), true);
Code (Text):LightAPI.deleteLight(location, true);
- collectChunks(Location loc); - Collects and returns a list of changed chunks.
Code (Text):LightAPI.collectChunks(player.getLocation());
- updateChunk(ChunkInfo info); - It sends the modified chunk players.
Advanced Methods:Code (Text):LightAPI.updateChunk(info);
- ServerModManager
- registerServerMod(ServerModInfo info); - Registration of the new platform. ServerModInfo contains a map with classes for initialization NMSHandler under the version of CraftBukkit implementation.
Code (Text):// Example code from LightAPI 3.0.0
ServerModInfo spigot = new ServerModInfo("Spigot");
spigot.getVersions().put("v1_8_R3", CraftBukkit_v1_8_R3.class);
spigot.getVersions().put("v1_9_R1", CraftBukkit_v1_9_R1.class);
spigot.getVersions().put("v1_9_R2", CraftBukkit_v1_9_R2.class);
spigot.getVersions().put("v1_10_R1", CraftBukkit_v1_10_R1.class);
ServerModManager.registerServerMod(spigot);
- unregisterServerMod(String modName); - Unregistration of CraftBukkit implementation.
Code (Text):ServerModManager.unregisterServerMod("Spigot");
- getNMSHandler(); - initialized NMSHandler after enable main plugin.
Events:Code (Text):ServerModManager.getNMSHandler();
- SetLightEvent
- DeleteLightEvent
- UpdateChunkEvent
Commands:
- /lightapi - main command
- /lightapi update - connect to GitHub and check update
Configuration:
Example code:Code (Text):# LightAPI v3.2.0-dev Configuration
# by BeYkeRYkt
version: 3 //version config
update-delay-ticks: 2 //frequency processing query in ticks
max-iterations-per-tick: 400
updater:
enable: true
repo: BeYkeRYkt/LightAPI
update-delay-ticks: 40
view-changelog: false
Special versions:
- BeYkeRYkt's example gist (1.4.1)
- BeYkeRYkt's example gist (1.4.2)
- BeYkeRYkt's example gist (2.0.1)
- BeYkeRYkt's example gist (3.0.0)
- LightAPI-b1649 for spigot build 1649
Known issues:
Source code:
- Cauldron on the wider area of the light sometimes does not work.
- Sometimes, after the installation of light it disappears.
- Sometimes, the light can not disappear.
- When you'll frequently update the chunks, the server begins to lags.
License is MIT.
https://github.com/BeYkeRYkt/LightAPI
If you find any bugs, I ask you to write about it in this thread.
![]()

LightAPI 3.2.9
Bukkit library for create invisible light source
-
DiscowZombie, mat41997, OoyschesteroO and 6 others like this.
Recent Updates
Recent Reviews
-
MelaniumAS
- 5/5,
Please users, use the following link since the plugin was transferred to another dev.
https://www.spigotmc.org/resources/lightapi-fork.48247/ -
Mario34TheBest
- 5/5,
Good resource, but when you add 1.15-1.16 support? We all java programmers need it
-
xuanzhou
- 5/5,
Good!It's useful for developers and some server.I wanted to mark 50starsbut only 5.May I reposted it to mcbbs.net(The biggest forum of China)?I'll mark the original page and source code page.Look forward.Thanks!
-
Il_totore
- 5/5,
Good api but please make it support 1.14+ versions
------------------80 character limit -
LordofLightning
- 5/5,
For those of you who are unable to notice obvious important information. Please scroll up to the top, where you will find a large line in mostly red stating 'RESOURCE IS INACTIVE! SWITCH TO THIS FORK BY @bottomdumber !"
In the future, don't leave bad reviews on abandoned resources, it won't help you in any way, it will only make other people despise you. -
TestMod
- 1/5,
Please Update This Plugin!
Please.
I cant use it.
Because DiceFurniture want this Plugin. -
mar_robHD
- 1/5,
Please Update IT!
Sonnst mache ich es!!!
Ich muss es dann Decompilen!
mar_robHD -
jupiter1390
- 5/5,
Need update for 1.12.1. It doesn't work with 1.12.1, also lightsource does :( d
-
Cuthmf
- 5/5,
Not work here, please helpme.
MY CODE:
new BukkitRunnable() {
@Override
public void run() {
for (Player p : Bukkit.getServer().getOnlinePlayers()) {
if (p.getInventory().getItemInOffHand().getType() == Material.TORCH) {
LightAPI.createLight(p.getLocation(), 15, true);
for (ChunkInfo info : LightAPI.collectChunks(p.getLocation())) {
LightAPI.updateChunk(info);
}
}
}
}
}.runTaskTimer(Main.getPlugin(Main.class) , 1,10);
new BukkitRunnable() {
@Override
public void run() {
for (Player p : Bukkit.getServer().getOnlinePlayers()) {
if (p.getInventory().getItemInOffHand().getType() == Material.TORCH) {
Location location = p.getLocation();
LightAPI.deleteLight(location.getWorld(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), true);
LightAPI.createLight(p.getLocation(), 15, true);
for (ChunkInfo info : LightAPI.collectChunks(p.getLocation())) {
LightAPI.updateChunk(info);
}
}
}
}
}.runTaskTimer(Main.getPlugin(Main.class), 5, 20);
}
} -
Pas02
- 5/5,
Please update to Spigot 1.9.4!!! Very nice Plugin!!!
-------------------------------------------------------------------------