Mob drops / mob spawns

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

LuckyMunch

New Member
Feb 24, 2021
6
0
1
23
So I want to make it so a selected part of my map to spawn a certain mob, I also would like it to if a player kills a mob they get money, is that possible?
 
It is, it will be quite complex tho.
not the drop part, if all cercumstances are right...

heres how you make a mob drop something custom:


Code:
on death:
      if victim is [Mob]:
            Clear the drops
            chance of 50%
            set {_drop} to [item] named "[Name]"
            drop {_drop} at victim's location ( or in players inventory)
            stop
so thats how you make the drop, for this to work tho the mob thats being killed will be *UNIQUE* on your server as it will interfeer *EVERYWHERE* but if the mob is unique that should work!

The Spawning part, i dont know how to do and im also trying to learn it...
so if anyone knows how to do it please reply :emoji_slight_smile:
 
So I want to make it so a selected part of my map to spawn a certain mob, I also would like it to if a player kills a mob they get money, is that possible?
To finish the spawning part from Julius, I have made something like this
(might not be the cleanest/best code but it works decent)

Code:
        set {_loc1} to a random integer between -110 and -25
        set {_loc2} to a random integer between -45 and 45
        loop all blocks in radius 2 around location({_loc1}, 69, {_loc2}, world "void"):
            if loop-block is not air:
                set {_loc1} to a random integer between -110 and -25
                set {_loc2} to a random integer between -45 and 45
        #spawn mob here
 
  • Like
Reactions: Julius Ohly
It is, it will be quite complex tho.
not the drop part, if all cercumstances are right...

heres how you make a mob drop something custom:


Code:
on death:
      if victim is [Mob]:
            Clear the drops
            chance of 50%
            set {_drop} to [item] named "[Name]"
            drop {_drop} at victim's location ( or in players inventory)
            stop
so thats how you make the drop, for this to work tho the mob thats being killed will be *UNIQUE* on your server as it will interfeer *EVERYWHERE* but if the mob is unique that should work!

The Spawning part, i dont know how to do and im also trying to learn it...
so if anyone knows how to do it please reply :emoji_slight_smile:
Thank you!
[doublepost=1619399085,1619399030][/doublepost]
To finish the spawning part from Julius, I have made something like this
(might not be the cleanest/best code but it works decent)

Code:
        set {_loc1} to a random integer between -110 and -25
        set {_loc2} to a random integer between -45 and 45
        loop all blocks in radius 2 around location({_loc1}, 69, {_loc2}, world "void"):
            if loop-block is not air:
                set {_loc1} to a random integer between -110 and -25
                set {_loc2} to a random integer between -45 and 45
        #spawn mob here
Is it possible to create a command that lets me set the spawn point for certain mobs?
 
Thank you!
[doublepost=1619399085,1619399030][/doublepost]
Is it possible to create a command that lets me set the spawn point for certain mobs?
i dont think so...
i mean theoretically yes! but not really if you dont want to spend hours coding... i recommend you just put the coords in the skript, ill work better and save a LOT of time...
 
Np Man!
[doublepost=1619617405,1619512778][/doublepost]but @LuckyMunch !
The part where you get money on kill of a mob should be able to be done like this: (not tested sorry)

[Code:skript]
On Death:
If Victim is <Mob>:
run [make console execute command /essentials money add <Sum>] (i think thats the command ¯\_(ツ)_/¯)
[/Code:skript]
 
Status
Not open for further replies.