Mobcatcher

Share scripts you wrote for Denizen-Bukkit here!
n0nnie
New
New
Posts: 4

Mobcatcher

Postby n0nnie » February 26th, 2018, 1:55 pm

This is a script to catch mobs with a snowball. Just insert into scriptsfolder, grab a snowball and throw it on a mob. If you are op you are not charged money but a spawnegg will also not be dropped.

Code: Select all

mobcatcher:
  type: world
  debug: false
  mobinject:
    - if <player.money> >= <def[amount]> && !<player.is_op> {
      - remove "<context.entity>"
      - drop i@monster_egg[spawn_egg=<def[type]>] <player.location.add[2,0,2]>
      #In english: You have captured context.entity
      - narrate "<red> Du hast <context.entity.name> gefangen"
      - money take quantity:<def[amount]>
      #In english: You were charged def[amount]
      - narrate "<red> Du zahlst <def[amount]> EM für den Fang"
      }
    - if <player.is_op> {
      - remove "<context.entity>"
      #in english: You were charged nuthin for being a op
      - narrate "<red> Du hast <context.entity.name> gefangen, Du zahlst nix wegen Op"
      }     
      else {
        #english: not enough money for capturung: You need def[amount]
        - narrate "<red>Du hast nicht genug Geld: Du brauchst <def[amount]> Eulen Mark!"
      }
  events:
    on entity damaged by snowball:
    #https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EntityType.html
    #Add other Mobs as you wish. Since this Script does not create own Spawneggs, look if a Spawnegg is existing for your mob type you want to catch!
    - choose "<context.entity.entity_type>":
      - case "sheep":
        #Mob Type to determine which Spawnegg will be dropped
        - define type "91"
        #Price which a catch will be cost
        - define amount "<util.random.int[250].to[300]>"
        #Do the ddenizenmagic - see mobinject-section above
        - inject locally mobinject
      - case "zombie":
        - define type "54"
        - define amount "<util.random.int[450].to[500]>"
        - inject locally mobinject
      - case "pig_zombie":
        - define type "57"
        - define amount "<util.random.int[400].to[500]>"
        - inject locally mobinject
      - case "zombie_villager":
        - define type "27"
        - define amount "<util.random.int[450].to[500]>"
        - inject locally mobinject       
      - case "spider":
        - define type "52"
        - define amount "<util.random.int[250].to[350]>"
        - inject locally mobinject 
      - case "cave_spider":
        - define type "59"
        - define amount "<util.random.int[500].to[600]>"
        - inject locally mobinject   
      - case "creeper":
        - define type "50"
        - define amount "<util.random.int[900].to[1000]>"
        - inject locally mobinject   
      - case "horse":
        - define type "100"
        - define amount "<util.random.int[2000].to[3000]>"
        - inject locally mobinject         
      - case "skeleton":
        - define type "51"
        - define amount "<util.random.int[450].to[500]>"
        - inject locally mobinject
      - case "slime":
        - define type "55"
        - define amount "<util.random.int[450].to[500]>"
        - inject locally mobinject   
      - case "ghast":
        - define type "56"
        - define amount "<util.random.int[4000].to[5000]>"
        - inject locally mobinject   
      - case "blaze":
        - define type "61"
        - define amount "<util.random.int[4000].to[5000]>"
        - inject locally mobinject   
      - case "witch":
        - define type "66"
        - define amount "<util.random.int[600].to[650]>"
        - inject locally mobinject   
      - case "pig":
        - define type "90"
        - define amount "<util.random.int[250].to[300]>"
        - inject locally mobinject   
      - case "cow":
        - define type "92"
        - define amount "<util.random.int[250].to[300]>"
        - inject locally mobinject         
      - case "chicken":
        - define type "93"
        - define amount "<util.random.int[250].to[300]>"
        - inject locally mobinject 
      - case "mushroom_cow":
        - define type "96"
        - define amount "<util.random.int[250].to[300]>"
        - inject locally mobinject 
      - case "villager":
        - define type "120"
        - define amount "<util.random.int[10000].to[20000]>"
        - inject locally mobinject 
      - default:
        #Error message if Mob can not be catched
        - narrate "<red>Dieser Mob kann nicht gefangen werden!"

Return to “Scripts”

Who is online

Users browsing this forum: No registered users and 0 guests