1
So I don't know how many people use MCreator, but for modding it's a good start!
So I've started to completely re-do a mod I worked on using MCreator called Elemental Knights, and I've had this bug:
Whenever I right click on the tomb block that I made which SHOULD spawn the mob I made, it spawns 2, one fully normal mob with ai and the full package, and another 'ghost' mob, fully inactive and un-interactive.
So, how do we fix this??
On MCreator, click on the block that will spawn the mob and click on the 'edit code' feature.
Scroll aaaaaaaaaalllllllllllllllllllllll the way down until you see this line of code:
Here is an image of the line of code
Make sure it has the mob name you're trying to spawn somewhere on that line. It will look a little different to mine, but it should be, basically, at the bottom of the script.
There should also be a gap just above this line. In that gap, type this in:
You do this because it is checking to make sure you are playing, or something. I don't really know, it works though.
So, overall you should have something like this:
Save and recompile the mod, run the client test environment and check to see if the 'ghost' is still being spawned.
So I've started to completely re-do a mod I worked on using MCreator called Elemental Knights, and I've had this bug:
Whenever I right click on the tomb block that I made which SHOULD spawn the mob I made, it spawns 2, one fully normal mob with ai and the full package, and another 'ghost' mob, fully inactive and un-interactive.
So, how do we fix this??
On MCreator, click on the block that will spawn the mob and click on the 'edit code' feature.
Scroll aaaaaaaaaalllllllllllllllllllllll the way down until you see this line of code:
Spoiler - click to reveal
if(true){
Entity sentity = EntityList.createEntityByName("knight001", world);if (sentity != null){sentity.setLocationAndAngles(i, j, k, world.rand.nextFloat() * 360F, 0.0F);world.spawnEntityInWorld(sentity);((EntityLiving)sentity).playLivingSound();}
}
Entity sentity = EntityList.createEntityByName("knight001", world);if (sentity != null){sentity.setLocationAndAngles(i, j, k, world.rand.nextFloat() * 360F, 0.0F);world.spawnEntityInWorld(sentity);((EntityLiving)sentity).playLivingSound();}
}
Make sure it has the mob name you're trying to spawn somewhere on that line. It will look a little different to mine, but it should be, basically, at the bottom of the script.
There should also be a gap just above this line. In that gap, type this in:
Spoiler - click to reveal
if(!world.isRemote)
So, overall you should have something like this:
Spoiler - click to reveal
if(!world.isRemote)
if(true){
Entity sentity = EntityList.createEntityByName("knight001", world);if (sentity != null){sentity.setLocationAndAngles(i, j, k, world.rand.nextFloat() * 360F, 0.0F);world.spawnEntityInWorld(sentity);((EntityLiving)sentity).playLivingSound();}
}
if(true){
Entity sentity = EntityList.createEntityByName("knight001", world);if (sentity != null){sentity.setLocationAndAngles(i, j, k, world.rand.nextFloat() * 360F, 0.0F);world.spawnEntityInWorld(sentity);((EntityLiving)sentity).playLivingSound();}
}
Save and recompile the mod, run the client test environment and check to see if the 'ghost' is still being spawned.
Tags |
tools/tracking
3627559
6
mcreator-entty-spawned-from-block-bug-fix
Create an account or sign in to comment.