跳到正文

LiLi | Living Lights

An API/Library mod for attaching light sources to entities.

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

A library mod for Fabric and NeoForge that lets entities emit real block light as they move.

  • Light is computed on the server and synced to every client tracking the entity.
  • Installing the mod alone changes nothing; every tag ships empty.
  • Required on both client and server.

API

All entry points live in io.github.jason13official.living_lights.api.common.lighting.

LightEmitter

Implement on your entity to emit light directly; checked first, computed on both sides.

public class GlowingMob extends Monster implements LightEmitter {

  @Override
  public int getLightEmission() {
    return this.isAggressive() ? 15 : 7;
  }
}

LightEmission.register

Add rules for any living entity; the brightest result wins.

public class MyMod {

  private void onAnEvent() {
    LightEmission.register(entity -> entity.isOnFire() ? 15 : 0);
    LightEmission.register(entity -> entity.hasEffect(MobEffects.GLOWING), 8);
  }
}

LightEmission.set / clear

Light entities that don’t tick, like part entities; call on both client and server, every time the entity moves.

public class EntityBodyPart {

  public void customTick() {
    LightEmission.set(segment, 15);
  }

  public void onRemoval() {
    LightEmission.clear(segment);
  }
}

Tags

  • Entity #living_lights:luminous: Always emits light level 15
  • Item #living_lights:luminous_when_equipped: Emits light while held or worn in any equipment slot
  • Item #living_lights:luminous_in_inventory: Emits light from anywhere in a player’s inventory

Tagged block items emit their block’s light level (torch 14, soul lantern 10); other items emit 15.

Data component

living_lights:light_emission (0-15) sets an exact light level for one stack while it’s equipped, overriding the item tags.

public class MyMod {

  private void onAnEvent() {
    stack.set(LightEmission.component(), 12);
  }
}
/give @s minecraft:blaze_rod[living_lights:light_emission=12]

常见问题

LiLi | Living Lights 支持哪些 Minecraft 版本?

LiLi | Living Lights 支持 Minecraft Java 版 26.1.2,可用的加载器:Fabric / NeoForge。下载时注意选择和你游戏版本一致的文件。

LiLi | Living Lights 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

jason13official 的其他作品

查看全部 →