Untitled

mail@pastecode.io avatar
unknown
plain_text
18 days ago
2.0 kB
2
Indexable
Never
mob_wave_spawner:
  type: task
  script:
    - repeat 5:
        - spawn zombie <location[zombie_spawn_location]>
        - spawn skeleton <location[skeleton_spawn_location]>
        - wait 30s

wave_check:
  type: task
  script:
    - if <player.flag[wave_active]>:
        - narrate "Waves are already active!"
    - else:
        - flag player wave_active
        - narrate "Starting the wave!"
        - run mob_wave_spawner
        - wait 1m
        - flag player wave_active remove
        - narrate "Waves ended."


wave_start:
  type: world
  events:
    on player right clicks block:
      - if <context.location> == <location[spawner_trigger_location]>:
          - run wave_check

custom_mob_spawn:
  type: task
  script:
    - define spawned_entities

    - define spawned_entities.zombie <spawn zombie <location[zombie_spawn_location]>>
    - adjust <[spawned_entities.zombie]> custom_name:Zombie_Wave
    - equip <[spawned_entities.zombie]> equipment:diamond_sword

    - define spawned_entities.skeleton <spawn skeleton <location[skeleton_spawn_location]>>
    - adjust <[spawned_entities.skeleton]> custom_name:Skeleton_Wave
    - equip <[spawned_entities.skeleton]> equipment:bow

    - narrate "Spawned Zombie: <[spawned_entities.zombie]>, Spawned Skeleton: <[spawned_entities.skeleton]>"
    - narrate "Available keys in spawned_entities map: <[spawned_entities].keys>"


set_zombie_spawn:
  type: task
  script:
    - define current_loc <player.location>
    - yaml id:zombie_spawns set spawn_<player.name> <[current_loc]>
    - narrate "Zombie spawn location set at your current location: <[current_loc]>"

set_skeleton_spawn:
  type: task
  script:
    - define current_loc <player.location>
    - yaml id:skeleton_spawns set spawn_<player.name> <[current_loc]>
    - narrate "Skeleton spawn location set at your current location: <[current_loc]>"

run_spawn_wave:
  type: task
  script:
    - narrate "Running custom mob spawn..."
    - run custom_mob_spawn
Leave a Comment