Date: 2020/12/23 15:42:21 UTC-08:00
            
Type: Denizen Script
        
# Item Scripts #
## - MONSTERBALL - ##
mobcapture:
  type: world
  events:
    after monsterball damages entity:
    # - Prevent players from deleting certain entities
    - define capturable <list[CHICKEN|COW|SHEEP|PIG|RABBIT|SKELETON|STRAY|ZOMBIE|HUSK|CREEPER|CAVE_SPIDER|SPIDER|BLAZE|ZOMBIFIED_PIGLIN|MAGMA_CUBE|SLIME]>
    - if <[capturable].contains[<context.entity.entity_type>]>:
        # - Drop spawn egg here
        - playeffect effect:TOTEM at:<context.entity.location> visibility:50 quantity:100 offset:2.0
        - playsound <player> sound:item_totem_use pitch:8 volume:0.2
        - drop <context.entity.entity_type>_spawn_egg <context.entity.location>
        - remove <context.entity>
    - else:
        - playsound <player> sound:entity_enderman_teleport pitch:1 volume:0.4
        - give monsterball
        - narrate "You can't capture this!"
        - stop
## - MONSTERBALL - ##