~ mcmonkey's simpler pastebin ~ Inspired by Hastebin ~ home page ~ Denizen help ~
click to use the normal pastebin instead ~ Click to make your own paste ~ click to duplicate and edit this paste


Title:
Type:
Date:
By:
Raw:
Other:
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2300

Custom Block Handler
Denizen Script
2019/11/23 09:49:47 UTC-08:00
Guest
Click here to view this paste as a raw text file | Or download the script


custom_blocks_handler_events:
  type: world
  events:
    on player places sponge:
      - if <player.item_in_hand.nbt[is_custom_block]||false>:
        - determine passively cancelled
        - define uuid <util.random.uuid>
        - wait 1t
        - spawn armor_stand[equipment=air|air|air|<item[<player.item_in_hand.scriptname>]>;gravity=false] <context.location.center.below[1.66]> save:as
        - modifyblock <context.location> spawner
        - adjust <context.location> spawner_type:<entity[dropped_item]>
        - note <context.location> as:customBlock_block_<[uuid]>
        - flag server customBlock_stand_<[uuid]>:<entry[as].spawned_entity>

    on player breaks spawner:
      - if <context.location.notable_name.starts_with[customBlock_block_]||false>:
        - define uuid <context.location.notable_name.after[_].after[_]>
        - determine passively <list[<item[<entity[<server.flag[customBlock_stand_<[uuid]>]>].equipment.helmet.scriptname>]>]>
        - wait 1t
        - remove <entity[<server.flag[customBlock_stand_<[uuid]>]>]>
        - note remove as:customBlock_block_<[uuid]>
        - flag server customBlock_stand_<[uuid]>:!