- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register








The script repo is an archive of historical scripts. For modern scripts, or to post your own, please use the Scripts forum section.





Staff Pick: Ambient Light


By thedadmin
Created: 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 script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
4700

ambienlight:
  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