Paste #125051: Testing Dummy

Date: 2024/07/28 00:53:36 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


test_dummy:
  type: command
  name: test_dummy
  description: spawns in a test dummy
  usage: /test_dummy
  permission: op
  aliases:
    - td
  script:
    - spawn test_dummy_ent <player.location>


test_dummy_ent:
  type: entity
  entity_type: husk
  debug: false
  mechanisms:
    max_health: 1
    health: 1
    has_ai: false
    silent: true

test_dummy_ent_handle:
  type: world
  debug: false
  events:
    on test_dummy_ent damaged:
      - determine passively cancelled
      - flag <context.entity> damage_taken:+:<context.damage>
      - if damage_stacker in <util.runlater_ids>:
        - adjust system cancel_runlater:damage_stacker
      - runlater damage_track_run id:damage_stacker delay:1.5s def:<context.entity>

damage_track_run:
  type: task
  debug: false
  definitions: entity
  script:
  - fakespawn text_display[text=<&c>[<&l><[entity].flag[damage_taken].round_to[2]><&c>];pivot=center;background_color=<color[#ffffff].with_alpha[0]>;interpolation_start=0;interpolation_duration=1.5s] <[entity].eye_location.random_offset[1]> duration:1.5s save:bar players:<server.online_players>
  - flag <[entity]> damage_taken:!
  - wait 3t
  - adjust <entry[bar].faked_entity> translation:0,2,0