- 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


Click here to create your own public paste ~ ~ click to duplicate and edit this paste


Titlefor Reason
TypeDenizen Script
Date2014/02/12 17:47:46 UTC-08:00
ByGuest
Other
Paste
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
1800
# | Handles the world event for entity spawning and fires @KillPlayer_Task
KillPlayer_World:
    type: world
    events:
      on entity spawns:
      # Run the attack script precisely one tick from now.
      - run KillPlayer_Task def:<context.location> delay:1t

# | Causes the entity at %location% to attack the nearest player
KillPlayer_Task:
    type: task
    definitions: location
    script:
    # If there is a player nearby, attack!
    - if <def[location].find.players.within[10].get[1]> != null {
      - attack <def[location].find.living_entities.within[5].get[1]> target:<def[location].find.players.within[10].get[1]>
      }



RawRaw



Pastes made: 59170