Paste #62893: Untitled Paste

Date: 2019/12/18 16:35:32 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


mimicninja:
  type: world
  debug: off
  events:
    on entity spawns:
    # So the script works
    - wait 1t 
    - if <context.entity.mythicmob.internal_name||null> == MimicNinja: 
    # Saves MimicNinja when it spawns to a list "MimicNinjaInstances"
      #- announce TestMimicNinja
      - flag server MimicNinjainstances:->:<context.entity>
    on entity despawns:
    - if <context.entity.mythicmob.internal_name||null> == MimicNinja: 
    # Removes MimicNinja when it despawns from a list "MimicNinjaInstances"
      #- announce MimicNinjaDespawned
      - flag server MimicNinjainstances:<-:<context.entity>
    on tick every:5:
    - if <server.flag[MimicNinjainstances].is_empty.not||false>:
      - foreach <server.flag[MimicNinjainstances]> as:MimicNinja:
        - if <[MimicNinja].target||null> != null:
          - if <[MimicNinja].target.entity_type> != PLAYER && <[MimicNinja].disguise.type> != <[MimicNinja].target.entity_type>:
            - disguise mob type:<[MimicNinja].target.entity_type> baby:<[MimicNinja].target.is_baby||false> target:<[MimicNinja]>
          - if <[MimicNinja].target.entity_type> == PLAYER && <[MimicNinja].disguise||null> == null:
            - disguise player name:<[MimicNinja].target.name> target:<[MimicNinja]>
        - else:
          - disguise remove target:<[MimicNinja]>
mimicninjavelocity:
  type: world
  debug: off
  events:
    on tick every:5:
    - if <server.flag[MimicNinjainstances].is_empty.not||false>:
      - foreach <server.flag[MimicNinjainstances]> as:MimicNinja:
        - if <[MimicNinja].target||null> != null:
          - define target:<[MimicNinja].target>
          - if <[target].flag[mimiclocation1].size> >= 2:
            - flag <[target]> mimiclocation1:<-:<[target].flag[mimiclocation1].first>
          - flag <[target]> mimiclocation1:->:<[target].location>
          - define magicvelocity:<[target].flag[mimiclocation1].first>
          - adjust <[MimicNinja]> velocity:<[magicvelocity].sub[<[target].location>]>
          - actionbar targets:<server.list_online_players> "<[magicvelocity].sub[<[target].location>].mul[0.0002]>"