Mob Spawners In Structures

Started by JustGameIn on Sun, 06/11/2017 - 12:54

Topic category: Advanced modding

Last seen on 08:55, 13. Oct 2020
Joined Jun 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Mob Spawners In Structures
Sun, 06/11/2017 - 12:54

I created a structure and I added in a witch spawner but when it spawns into the world, it turns into a pig spawner. I also changed the metadata of the spawner in the code but it still does not work.

 k + 5), Block.getBlockById(52).getStateFromMeta(66), 3);

 

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
The mob that the spawner
Sun, 06/11/2017 - 13:11

The mob that the spawner spawns is not defined by its metadata. It is actually stored in its TileEntity.
You actually need to get the TileEntity, get its instance of MobSpawnerBaseLogic and set string name of your desired entity using MobSpawnerBaseLogic#setEntityName()

Last seen on 17:59, 16. Oct 2020
Joined Mar 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
can you explain it a little…
Sun, 07/15/2018 - 17:01

can you explain it a little bit better.

i tried a couple of things but they didn't seem to work...

i know a bit of coding.