Staff Pick: Ambient Light
By
thedadminCreated: 2016/12/14 10:31:01 UTC-08:00 (8 years and 11 days ago)
Edited: 2016/12/14 10:31:01 UTC-08:00 (8 years and 11 days ago)
Likes: 1
Staff pick as of: 2016/12/14 20:26:37 UTC-08:00 (8 years and 10 days ago)
Denizen Version: 1.0.1-SNAPSHOT (Build 1630) Core Version 1.15 (Build 77)
Script Version: 1.0
Description:
This script was actually inspired by the script by mcmonkey called "Torch Light", but updated to include different items with varying light intensities and an option to toggle Ambient Light on and off via the /ambientlight command. This is useful for players with weaker machines and those already using optifine.
Installation:
Just as simple as the script it is based off of. Just put it in your script folder!
Download script |
View raw scriptambienlight:
type: command
name: ambientlight
usage: /ambientlight
script:
- if <player.has_flag[ambientlightoff]> {
- light <context.previous_location> reset
- flag player ambientlightoff:!
- narrate "<&o>Ambient Lighting has been Enabled. Use this command again to disable Ambient Lighting.<&r>"
- queue clear
}
- flag player ambientlightoff
- narrate "<&o>Ambient Lighting has been Disabled. Use this command again to Enable Ambient Lighting.<&r>"
ambient:
type: world
debug: false
events:
on player steps on block:
- if <player.has_flag[ambientlight]> {
- light <context.previous_location> reset
- flag player ambientlight:!
}
- if <player.has_flag[ambientlightoff]> {
- queue clear
}
- if <player.item_in_hand.material.name> == torch || <player.item_in_offhand.material.name> == torch {
- light <context.location.add[0,1,0]> 10
- flag player ambientlight
}
- if <player.item_in_hand.material.name> == glowstone || <player.item_in_offhand.material.name> == glowstone {
- light <context.location.add[0,1,0]> 14
- flag player ambientlight
}
- if <player.item_in_hand.material.name> == sea_lantern || <player.item_in_offhand.material.name> == sea_lantern {
- light <context.location.add[0,1,0]> 14
- flag player ambientlight
}
- if <player.item_in_hand.material.name> == redstone_torch_on || <player.item_in_offhand.material.name> == redstone_torch_on {
- light <context.location.add[0,1,0]> 7
- flag player ambientlight
}
on player quits:
- if <player.has_flag[ambientlight]> {
- light <context.previous_location> reset
- flag player ambientlight:!
}
View History