Cats And Dogs

  • Thread starter Deleted member 5254
  • Start date
  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

D

Deleted member 5254

Custom effects for spawning cats, with options for names, age, color(style), and owner.
Requires Skript mirror
This is the snytax to either put at the top of your script or in another script that loads before the one you are using it with. (Examples below)
code_language.skript:
import:
    org.bukkit.entity.Ocelot$Type

effect:
    patterns:
        spawn [%-integer% of] baby (0¦black|1¦siamese|2¦red|3¦wild|4¦random) cat [named %-string%] [belonging to %-player%] at %location%
        spawn [%-integer% of] [adult] (0¦black|1¦siamese|2¦red|3¦wild|4¦random) cat [named %-string%] [belonging to %-player%] at %location%
    trigger:
        if expression-1 is not set:
            set {_amount} to 1
        else:
            set {_amount} to expression-1
        if matched pattern is 1:
            spawn {_amount} of baby ocelot at expression-4
        else if matched pattern is 2:
            spawn {_amount} of adult ocelot at expression-4
        last spawned ocelot.setTamed(true)
        if parse mark is between 0 and 3:
            set {_type} to Type.values()[parse mark]
        else if parse mark is 4:
            set {_type} to Type.values()[random integer between 0 and 3]
        last spawned ocelot.setCatType({_type})
        if expression-2 is set:
            set name of last spawned ocelot to expression-2
        if expression-3 is set:
            last spawned ocelot.setOwner(expression-3)

Examples of use:
code_language.skript:
spawn baby black cat named "pete" at player
spawn 2 of baby siamese cat named "spots" belonging to player at player
spawn adult red cat at player
spawn wild cat named "Whiskers" belonging to arg-1 at arg-1



Custom effect for spawning dogs, with options for age, name, collar color and owner.
Requires Skript mirror
This is the snytax to either put at the top of your script or in another script that loads before the one you are using it with. (Examples below)
code_language.skript:
import:
    org.bukkit.DyeColor

effect:
    patterns:
        spawn [%-integer% of] [(0¦adult|1¦baby)] dog [named %-string%] [with %-color% collar] [belonging to %-player%] at %location%
    trigger:
        if expression-1 is not set:
            set {_amount} to 1
        else:
            set {_amount} to expression-1
        if parse mark is 0:
            spawn {_amount} of adult wolf at expression-4
        else if parse mark is 1:
            spawn {_amount} of baby wolf at expression-4
        last spawned wolf.setTamed(true)
        if expression-2 is set:
            set name of last spawned wolf to expression-2
        if expression-3 is set:
            last spawned wolf.setCollarColor(DyeColor.valueOf(capitalized "%expression-3%"))
        if expression-4 is set:
            last spawned wolf.setOwner(expression-4)

Examples of use:
code_language.skript:
spawn baby dog named "Lil Pup" at player
spawn baby dog named "Lil Rover" with blue collar belonging to player at player
spawn 1 of adult dog named "Rover" with yellow collar belonging to arg-1 at arg-1
spawn dog with green collar at player
 
  • Like
Reactions: Runakai