~ 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
1900

Custom Blocks 2.0
Denizen Script
2019/11/24 08:26:30 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
  debug: false
  events:
    on player places sponge:
      - if <player.item_in_hand.script.yaml_key[is_custom_block]||false>:
        - determine passively cancelled
        - wait 1t
        - spawn armor_stand[custom_name=customBlock_<player.item_in_hand.scriptname>;equipment=air|air|air|<player.item_in_hand.scriptname>;gravity=false;visible=false] <context.location.center.below[1.66]>
        - modifyblock <context.location> cracked_stone_bricks
        - adjust <context.location> spawner_type:<entity[dropped_item]>

    on player breaks cracked_stone_bricks:
      - define customBlockStands:<context.location.center.below[1.66].find.entities[armor_stand].within[0.1].filter[custom_name.contains[customBlock]]>
      - if <[customBlockStands].size||0> >= 1:
        - determine passively <[customBlockStands].get[1].as_entity.equipment.head.script.yaml_key[custom_block_drop].as_item||<[customBlockStands].get[1].as_entity.custom_name.after[_].as_item>>
        - wait 1t
        - remove <[customBlockStands].get[1]>