Custom Mob Spawning Item And A Small Problem

Started by TheDuckKnight_Mc on Thu, 07/01/2021 - 18:42

Topic category: Help with modding (Java Edition)

Last seen on 08:00, 29. Jul 2021
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Custom Mob Spawning Item And A Small Problem
Thu, 07/01/2021 - 18:42

Alright, let's get straight to the point: I am trying to make an item that when right clicked on a block spawns a mob. And that part is the easy part.

What I'm struggling to figure out how to do is how to make it so that once I spawn one mob, I can't spawn more. And once the spawned mob dies, I can spawn a new one. 

Basically, I'm trying to make a spawn egg that only can spawn one mob at a time.

Is that even possible? I figured I'd have to use global variables (probably player_persistent) 

Any and all help is appreciated, though the news of "it's impossible" would be quite disappointing.

Thank you :)

Last seen on 17:56, 17. Sep 2021
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
oh this is very easy, I had…
Wed, 07/07/2021 - 06:40

oh this is very easy, I had a problem with something that needed something similar. its not actually easy but more tedious I will send you the images soon I am testing it out first

Last seen on 17:56, 17. Sep 2021
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
It was more annoying then I…
Wed, 07/07/2021 - 08:37

It was more annoying then I expected but this is how its done 

https://imgur.com/a/moc4ieI

(btw images are in order)

I will still give you a more detailed explanation though, first you make the variable in the picture, second for the item that spawns the mob, copy that trigger to spawn it, the next one is the mob you want to spawn (I'm treating this mob as a pet or summon that helps you fight) the third image should be copied to when the entity makes contact with the player, the forth image should be when the entity dies (copy the procedures exactly for this to work) and the last one should be a procedure by itself, just copy it and make sure the trigger is on player tick, I hope I helped. 

 

 

if this mob was not supposed to be a mob you summon to fight for you then you will need to change things, but I'm afraid I wasn't able to work it out, so if you want this to be a summonable boss to fight or something then you will have to tweak most of it if not all.

Last seen on 17:56, 17. Sep 2021
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
also I had to make it so the…
Wed, 07/07/2021 - 08:38

also I had to make it so the mob will spawn in you for this to work, also remove the message boxes as well, I only had them for testing