diff --git a/docs/scarpet/api/Auxiliary.md b/docs/scarpet/api/Auxiliary.md index 1b05a90b..d9589c99 100644 --- a/docs/scarpet/api/Auxiliary.md +++ b/docs/scarpet/api/Auxiliary.md @@ -753,7 +753,8 @@ system calls. In all circumstances, these are only provided as read-only. * `world_center` - Returns coordinates of the center of the world with respect of the world border * `world_size` - Returns radius of world border for current dimension. * `world_max_size` - Returns maximum possible radius of world border for current dimension. - * + * `world_min_spawning_light` - Returns minimum light level at which mobs can spawn for current dimension, taking into account datapacks + ##### Relevant gameplay related properties * `game_difficulty` - current difficulty of the game: `'peaceful'`, `'easy'`, `'normal'`, or `'hard'` * `game_hardcore` - boolean whether the game is in hardcore mode diff --git a/src/main/java/carpet/script/utils/SystemInfo.java b/src/main/java/carpet/script/utils/SystemInfo.java index 99390853..8022477c 100644 --- a/src/main/java/carpet/script/utils/SystemInfo.java +++ b/src/main/java/carpet/script/utils/SystemInfo.java @@ -200,6 +200,7 @@ public class SystemInfo { }); return MapValue.wrap(rules); }); + put("world_min_spawning_light", c-> NumericValue.of(c.s.getLevel().dimensionType().monsterSpawnBlockLightLimit())); put("source_entity", c -> EntityValue.of(c.source().getEntity())); put("source_position", c -> ValueConversions.of(c.source().getPosition()));