Started by
ninjawizard1234
on
Topic category: Help with Minecraft modding (Java Edition)
i really could use some help with this, i use to have this procedure on older versions of MCreator, to make my Egg Entity spawn CHILD/Baby mobs
(i cant believe the procedures still dont have a simple [Spawn Entity -> Specific Type -> Child ?] yet, very disapointing...)
this is the part of the procedure that spawn the mob:
if (entity instanceof GeckoGiantDayEggEntity) {
if (entity.getPersistentData().getDouble("eggtimer") < 300) {
entity.getPersistentData().putDouble("eggtimer", (entity.getPersistentData().getDouble("eggtimer") + 1));
} else {
if (!entity.level().isClientSide())
entity.discard();
rando = Math.random();
if (world instanceof Level _level) {
if (!_level.isClientSide()) {
_level.playSound(null, BlockPos.containing(x, y, z), ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.egg.throw")), SoundSource.NEUTRAL, 1, 1);
} else {
_level.playLocalSound(x, y, z, ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.egg.throw")), SoundSource.NEUTRAL, 1, 1, false);
}
}
if (rando <= 0.4) {
if (world instanceof ServerLevel _level) {
Entity entityToSpawn = WizardAnimalsPlusModEntities.GECKO_GIANT_DAY_MALE.get().spawn(_level, BlockPos.containing(x, y, z), MobSpawnType.MOB_SUMMONED);
if (entityToSpawn != null) {
entityToSpawn.setYRot(world.getRandom().nextFloat() * 360F);
}
}
} else if (rando > 0.4) {
if (world instanceof ServerLevel _level) {
Entity entityToSpawn = WizardAnimalsPlusModEntities.GECKO_GIANT_DAY.get().spawn(_level, BlockPos.containing(x, y, z), MobSpawnType.MOB_SUMMONED);
if (entityToSpawn != null) {
entityToSpawn.setYRot(world.getRandom().nextFloat() * 360F);
}
}
}
}
}
and this is how i use to do on previous verions (last part there):
all those libraries are gone now... so sad... can someone plz help me fix/update this? thanks guys...
this is the part that dont work anymore :
is it possible maybe to summon the mob with commands (on the procedure) and make it child maybe? really need some help here i had more than 1000 points before i lost my username/password :(
nvm guys i was able to summon it child with commands ;)