How to code a custom spawn egg.

Started by Snyperscopz on

Topic category: Help with MCreator software

Last seen on 23:28, 7. Jan 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to code a custom spawn egg.

I'm completely new to coding and cant figure out how to make a spawn egg summon my custom boss.

Last seen on 19:40, 29. Jan 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When you create a mob it…
Mon, 12/27/2021 - 07:54

When you create a mob it automatically creates a spawn egg

Last seen on 13:58, 21. Jan 2023
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
just check if the make this…
Mon, 12/27/2021 - 22:06

just check if the make this mob a boss with a bossbar is checked

Last seen on 23:28, 7. Jan 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I want to make the spawn egg…
Tue, 12/28/2021 - 04:48

I want to make the spawn egg craftable. When I go to make a recipe the spawn egg doesn't show in the custom elements so I cant make it carftable.

Last seen on 06:15, 11. Jul 2022
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is simply done by code…
Wed, 12/29/2021 - 06:48

This is simply done by code editing: I'll walk you thru it step by step.

1st: Create a living entity and make sure the spawning egg is checked

2nd: Create a recipe using the recipe design you want. For the output, just pick any other spawn egg (like turtle)
 

Now for the complicated part:

3rd:Edit the recipe code directily, this is done by selecting the left icon below the green + sign, look for "Edit code for selected mod element"

4th: Once you done it, it will open a new tab on mcreator with a .json file, now this is where you replace the turtle egg with your custom mob egg. There are 2 things to replace, first is the mod group, 2nd is the egg:

It should look like this:
the "group" and "item from key" is automatically set by mcreator to the ones you set on step 2, the thing you just need to edit is on this is the result - items.

By default, a turtle egg will have it like this: minecraft:turtle_spawn_egg
just replace the word minecraft with your groupname and the turtle_spawn_egg with your custom mob egg. Dont delete the : (colon) between them

To get your spawn egg code btw, just edit your living entity mob (Similar to step 3 but instead click the .java and not the renderer)

5th: save it and lock the code. Locking is needed or else mcreator wont save your changes, run the game and try it out ingame.

{
  "group": "YOURMODGROUPNAMEHERE",
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "01",
    " 3"
  ],
  "key": {
    "0": {
      "item": "SOMERECIPEITEMHERE"
    },
    "1": {
      "item": "SOMERECIPEITEMHERE"
    },
    "3": {
      "item": "SOMERECIPEITEMHERE"
    }
  },
  "result": {
    "item": "YOURMODGROUPNAMEHERE:YOURCUSTOMMOB_spawn_egg",
    "count": 1
  }
}

 

Last seen on 23:28, 7. Jan 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I Followed your steps and…
Wed, 12/29/2021 - 15:34

I Followed your steps and now it says Errors in currently selected datapacks prevented world from loading every time I try create a world im not sure what I did wrong so here is my code.

 "group": "Misc",
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "012",
    "345",
    "678"
  ],
  "key": {
    "0": {
      "item": "manacraft:frosted_helmet"
    },
    "1": {
      "item": "manacraft:frost_piece"
    },
    "2": {
      "item": "manacraft:frosted_chestplate"
    },
    "3": {
      "item": "manacraft:frost_piece"
    },
    "4": {
      "item": "manacraft:frosted_magi_bar"
    },
    "5": {
      "item": "manacraft:frost_piece"
    },
    "6": {
      "item": "manacraft:frosted_leggings"
    },
    "7": {
      "item": "manacraft:frost_piece"
    },
    "8": {
      "item": "manacraft:frosted_boots"
    }
  },
  "result": {
    "item": "Misc:Abominable snowman_spawn_egg",
    "count": 1
  }
}

 

Last seen on 06:15, 11. Jul 2022
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Replace Misc by your mod…
Wed, 12/29/2021 - 20:56

Replace Misc by your mod group name. On your workspace, click the blue icon on the top right, it should be called "Workspace Settings", On it copy the Mod ID Namespace, paste it there instead of Misc.

Last seen on 23:28, 7. Jan 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So Is the Mod Id already…
Thu, 12/30/2021 - 03:24

So Is the Mod Id already there and I just copy it and put it in the code

because if so it still dosnt work

 

 

Last seen on 23:28, 7. Jan 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
My code now looks like this…
Thu, 12/30/2021 - 03:38

My code now looks like this now

"group": "manacraft",
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "012",
    "345",
    "678"
  ],
  "key": {
    "0": {
      "item": "manacraft:frosted_helmet"
    },
    "1": {
      "item": "manacraft:frost_piece"
    },
    "2": {
      "item": "manacraft:frosted_chestplate"
    },
    "3": {
      "item": "manacraft:frost_piece"
    },
    "4": {
      "item": "manacraft:frosted_magi_bar"
    },
    "5": {
      "item": "manacraft:frost_piece"
    },
    "6": {
      "item": "manacraft:frosted_leggings"
    },
    "7": {
      "item": "manacraft:frost_piece"
    },
    "8": {
      "item": "manacraft:frosted_boots"
    }
  },
  "result": {
    "item": "manacraft:Abominable_snowman_spawn_egg",
    "count": 1
  }
}

 

Last seen on 06:15, 11. Jul 2022
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Mate... I told you, ONLY…
Fri, 12/31/2021 - 01:00

Mate... I told you, ONLY EDIT THE LINE FROM ITEM,.....
Look at what I've said at first, see?
the "group" and "item from key" is automatically set by mcreator to the ones you set on step 2, the thing you just need to edit is on this is the result - items.

The MISC on group tag is the one from the creative tab, if you didnt add a creative tab, of course it will not work.....

The reason WHY i've said "group": "YOURMODGROUPNAMEHERE", is because I thought you already have a creative tab of your own. but instead you use Misc minecraft creative tab....

JUST EDIT THE RESULT. DONT DO ANYTHINS STUPID ON THE GROUP TOP TAG.

 

"result": { "item": "manacraft:Abominable_snowman_spawn_egg", "count": 1 }

This is already correct if your mod id nameplate is manacraft and your spawn egg name is Abominable snowman.

Last seen on 19:32, 20. Jul 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hey uh how do you change the…
Fri, 07/08/2022 - 20:14

hey uh how do you change the last line to something custom mine stays as "minecraft:pig_spawn_egg" and i cant change it

Last seen on 19:32, 20. Jul 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
please help me
Fri, 07/08/2022 - 20:23

please help me

Last seen on 19:32, 20. Jul 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
my code looks like this and…
Fri, 07/08/2022 - 20:23

my code looks like this and I CANT change it:
 

{
  "group": "mog",
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "012",
    "345",
    "678"
  ],
  "key": {
    "0": {
      "item": "minecraft:redstone_block"
    },
    "1": {
      "item": "minecraft:redstone_block"
    },
    "2": {
      "item": "minecraft:redstone_block"
    },
    "3": {
      "item": "minecraft:glass_pane"
    },
    "4": {
      "item": "minecraft:white_stained_glass_pane"
    },
    "5": {
      "item": "minecraft:redstone_block"
    },
    "6": {
      "item": "minecraft:redstone_block"
    },
    "7": {
      "item": "minecraft:redstone_block"
    },
    "8": {
      "item": "minecraft:redstone_block"
    }
  },
  "result": {
    "item": "minecraft:pig_spawn_egg",
    "count": 1
  }
}