Paste #69373: Door Closer

Date: 2020/05/21 11:42:33 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18


Door_Closer:
  type: world
  debug: false
  events:
    after player right clicks *door|*_gate priority:2:
      - if !<context.location.material.switched>:
        - stop
      - wait 2s
      - waituntil <context.location.find.entities[player].within[3].size.is[==].to[0]>
      - if <context.location.material.switched>:
        - switch <context.location> state:off
        - choose <context.location.material.name.after_last[_]>:
          - case door:
            - playsound <context.location> BLOCK_WOODEN_DOOR_CLOSE
          - case trapdoor:
            - playsound <context.location> BLOCK_WOODEN_TRAPDOOR_CLOSE
          - case gate:
            - playsound <context.location> BLOCK_FENCE_GATE_CLOSE