Paste #122015: Immune

Date: 2024/04/15 15:30:51 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


projectile_remove:
  type: task
  definitions: projectile
  script:
  - remove <[projectile]>

projectile1:
    type: task
    definitions: playerloc | headitem | speed | range | hitbox | damagescript | damage | knockback
    script:
        # SPAWN ARMORSTAND
        - spawn armor_stand <[playerloc]> save:projectile
        - define projectile <entry[projectile].spawned_entity>
        - equip <[projectile]> head:<[headitem]>
        - adjust <[projectile]> armor_pose:head|<player.location.pitch.to_radians>,0,0


        # PUSH ARMORSTAND
        - push <[projectile]> origin:<player> destination:<[range]> speed:<[speed]> script:projectile_remove def:<entry[projectile].spawned_entity> force_along no_rotate no_damage

        # CHECK MOBS
        - define hit 0
        - while <[projectile].is_spawned>:
            - foreach <[projectile].location.find_entities[zombie].within[5].deduplicate> as:targets:
                ## MOB IMMUNE FOR THIS PROJECTILE AFTER DAMAGESCRIPT 
                - run <[damagescript]> def:<[damage]>|<[knockback]>|<[targets]>
            - wait 1t

projectiledamage:
  type: task
  definitions: damage | knockback | targets
  script: