~ 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

Diff note for paste #17169
Diff
2015/06/30 13:53:42 UTC-07:00
Guest
Click here to view this paste as a raw text file | Or download the script


 Bender:
   type: assignment
   Interact Scripts:
   - 1 NPC_Bender
 NPC_Bender:
   type: interact
   actions:
     on assignment:
     - trigger name:damage state:true
   steps:
     1:
       click trigger:
         script:
         - define %bender_type% <npc.flag[fire]>
 #                                        ^^^
 #                     Make sure you set this flag somewhere
 #
         - if %bender_type% == fire {
           - define blocks li@m@netherrack|m@fire|m@lava
 #                                           ^^^
 #                                      Blocks to bend
           } else if %bender_type% == water {
 # etc
           } else if %bender_type% == earth {
 # etc
           } else if %bender_type% == air {
 # etc
           }
-        - define lift_blocks <npc.location.find.blocks[<def[blocks]>].within[70]>
+        - define lift_blocks <npc.location.find.blocks[%blocks%].within[70]>
 #                                                                           ^^^
 #                                                                      set the range
         - flag <npc> remaining_blocks:|:%lift_blocks%
         - run s@BenderBlocks as:<npc>
 
 BenderBlocks:
   type: task
   script:
   - if <npc.flag[remaining_blocks].as_list.size> > 0 {
     - define location <npc.flag[remaining_blocks].as_list.random>
     - define block <%location%.material.id>
     - modifyblock %location% m@air
     - spawn e@falling_block,%block%[velocity=<npc.location.simple.add[0,2,0]>] %location% save:%location%_block
     - push <entry[%location%_block].spawned_entities> destination:<npc.location.simple.add[0,2,0]> speed:0.1
     - flag <npc> remaining_blocks:<-:%location%
     - wait d@1.5s
     - run s@BenderBlocks as:<npc>
     }