Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

DaNatin

Members
  • Joined

  • Last visited

Everything posted by DaNatin

  1. Which is what? And where do I apply it?
  2. I'm trying to enable a mob to spawn tall grass as it moves, much like how a snow golem spawns in snow as it walks around. Thing is... It's spawning dead bushes rather than tall grass... Here's the code I grabbed from EntitySnowman: public void onLivingUpdate() { super.onLivingUpdate(); for (i = 0; i < 4; ++i) { j = MathHelper.floor_double(this.posX + (double)((float)(i % 2 * 2 - 1) * 0.25F)); int k = MathHelper.floor_double(this.posY); int l = MathHelper.floor_double(this.posZ + (double)((float)(i / 2 % 2 * 2 - 1) * 0.25F)); if (this.worldObj.getBlockId(j, k, l) == 0 && this.worldObj.getBiomeGenForCoords(j, l).getFloatTemperature() < 0.8F && Block.snow.canPlaceBlockAt(this.worldObj, j, k, l)) { this.worldObj.setBlock(j, k, l, Block.snow.blockID); } } } Then I changed some things on the bottom method: if (this.worldObj.getBlockId(j, k, l) == 0 && this.worldObj.getBiomeGenForCoords(j, l).getFloatTemperature() < 0.6F && Block.grass.canPlaceBlockAt(this.worldObj, j, k, l)) { this.worldObj.setBlock(j, k, l, Block.tallGrass.blockID); } Of course, I'd change some variables to what I want, such as Block.snow to Block.tallGrass. I messed around with the getFloatTemperature, but every time I change it to something it spawns in dead bushes It seems as if anything above 0.7F, nothing spawns
  3. Having trouble on how to make a mob inflict knockback damage. What method should I add in my mob's code to do so? Please be specific when mentioning a certain method
  4. Well, I created a custom rendering class for my rocket launcher, But it only renders in 3rd person... Here is my RenderItemRocketLauncher package battleofthebeasts.render; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainerCreative; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.ArrowLooseEvent; import org.lwjgl.opengl.GL11; import battleofthebeasts.models.RocketLauncherModel; public class RenderRocketLauncher implements IItemRenderer { //public static final ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png"); protected RocketLauncherModel rocketlaunchermodel; public RenderRocketLauncher() { rocketlaunchermodel = new RocketLauncherModel(); } // protected ResourceLocation func_110832_a(RocketLauncherModel par1EntitySpiderQueen) //{ // return Texture; //} @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch(type) { case EQUIPPED: return true; default: return false; } } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return false; } public EnumAction EQUIPPED(ItemStack par1ItemStack) { return EnumAction.bow; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch(type) { case EQUIPPED: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.func_110577_a(new ResourceLocation("battleofthebeasts", "textures/models/RocketLauncher.png")); //ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png"); boolean isFirstPerson = false; if(data[1] != null && data[1] instanceof EntityPlayer) { if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F))) { //ThirdPerson isFirstPerson = false; GL11.glTranslatef(0.4F, 0.5F, 0.08F); GL11.glRotatef(-26F, 1.0F, 0.0F, 0.0F); //X GL11.glRotatef(165F, 0.0F, 1.0F, 0.0F); //y GL11.glRotatef(140F, 1.0F, 0.0F, 1.0F); //z } else { if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 0.0F))) //First Person isFirstPerson = true; GL11.glTranslatef(-0.0F, 0.0F, 0.0F); GL11.glRotatef(0F, 1.0F, 0.0F, 0.0F); //X GL11.glRotatef(0F, 0.0F, 1.0F, 0.0F); //y GL11.glRotatef(0F, 1.0F, 0.0F, 1.0F); //z rocketlaunchermodel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.7F); } } else { GL11.glTranslatef(-0.05F, 0F, -0.0F); } } //Size rocketlaunchermodel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.07F); GL11.glPopMatrix(); default: break; } } }
  5. Well, after I exported my mod, I decided to test it. All the mob textures are "missing" In the Dev Console it says JavaFileNotFoundException: battleofthebeasts: /textures/entity/GoblinTheif.png So, I went into my mod directory Battle of the Beasts 1.6.2.zip\assets\battleofthebeasts\textures\entity\GoblinTheif.png Dunno what's wrong, If I test my mod in eclipse, the texture works I think it's the directory on export, but I am unsure on how to fix it
  6. Is there anything else to change on the other classes? The freaking rocket is still invisible
  7. hydroflame, I know you are one of the most helpful peeps on Forge, but I'm going to have to ask you to re-type in the entire RenderCode for me... and btw, the arguments were added automatically, If i were to remove it, it will come out as an error
  8. STILL invisible... Here is what I have in my RenderRocket RenderRocket package assets.battleofthebeasts.render; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import assets.battleofthebeasts.common.BattleOfTheBeastsMod; import assets.battleofthebeasts.models.RocketModel; public class RenderRocket extends RenderLiving { public static final ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "textures/entity/Rocket.png"); public RenderRocket(RocketModel par1RocketModel, float par2) { super(par1RocketModel, par2); } public static void doRender(RocketModel model, Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { model.render(par1Entity, par2, par2, par2, par2, par2, par2); } protected ResourceLocation func_110775_a(Entity par1Entity) { return Texture; } }
  9. GotoLink, I copied your method, Nothing really changed much... Can you show me how to call the model.render exactly?
  10. I have an item (ItemRocketLauncher) Which, onItemRightClick spawns in the EntityRocket... BUT ITS INVISIBLE I decided to make a techne model... exported it as a model, fixed errors... still invisible. Here is the code: ItemRocketLauncher package assets.battleofthebeasts.common.items; import java.util.List; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import assets.battleofthebeasts.common.BattleOfTheBeastsMod; import assets.battleofthebeasts.entity.projectiles.EntityRocket; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemRocketLauncher extends Item { public ItemRocketLauncher(int id) { super(id); this.setMaxStackSize(1); this.setCreativeTab(CreativeTabs.tabMaterials); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister reg) { this.itemIcon = reg.registerIcon(BattleOfTheBeastsMod.modid + ":" + this.getUnlocalizedName()); } @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if(par3EntityPlayer.capabilities.isCreativeMode||par3EntityPlayer.inventory.consumeInventoryItem(BattleOfTheBeastsMod.ItemWizardPower.itemID)) { par2World.playSoundAtEntity(par3EntityPlayer, "fireworks.launch", 0.8F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntityRocket(par2World, par3EntityPlayer)); } } return par1ItemStack; } } EntityRocket package assets.battleofthebeasts.entity.projectiles; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import assets.battleofthebeasts.common.BattleOfTheBeastsMod; public class EntityRocket extends EntityThrowable { //field_92057 = ExplosionRadius public int field_92057_e = 3; private Entity shootingEntity; private double speed = 0.3F; public EntityRocket(World par1World) { super(par1World); this.motionX*=speed; this.motionY*=speed; this.motionZ*=speed; } @Override protected float getGravityVelocity() { return 0; } public EntityRocket(World par1World, EntityPlayer par3EntityPlayer) { super(par1World, par3EntityPlayer); } public EntityRocket(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6); } protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { //| Make this true of you want to spawn fire on explosion //V this.worldObj.newExplosion((EntityRocket)null, this.posX, this.posY, this.posZ, (float)this.field_92057_e, false, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); this.setDead(); } } RenderRocket package assets.battleofthebeasts.render; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import assets.battleofthebeasts.common.BattleOfTheBeastsMod; import assets.battleofthebeasts.entity.projectiles.EntityRocket; import assets.battleofthebeasts.models.RocketModel; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class RenderRocket extends RenderLiving { public static final ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/Rocket.png"); public RenderRocket(RocketModel par1RocketModel, float par2) { super(par1RocketModel, par2); } @Override public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { GL11.glPushMatrix(); GL11.glPopMatrix(); GL11.glRotatef(90F, 0F, 1.0F, 0.0F); } protected ResourceLocation func_110832_a(EntityRocket par1EntityRocket) { return Texture; } protected ResourceLocation func_110775_a(Entity par1Entity) { return this.func_110832_a((EntityRocket)par1Entity); } } RocketModel // Date: 8/18/2013 9:33:30 PM // Template version 1.1 // Java generated by Techne // Keep in mind that you still need to fill in some blanks // - ZeuX package assets.battleofthebeasts.models; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class RocketModel extends ModelBase { //fields ModelRenderer Front; ModelRenderer Middle; ModelRenderer Tip; ModelRenderer End; public RocketModel() { textureWidth = 64; textureHeight = 64; Front = new ModelRenderer(this, 2, 6); Front.addBox(-2F, -2F, -6F, 4, 4, 6); Front.setRotationPoint(0F, 0F, 0F); Front.setTextureSize(64, 64); Front.mirror = true; setRotation(Front, 0F, 0F, 0F); Middle = new ModelRenderer(this, 2, 18); Middle.addBox(-1F, -1F, 0F, 2, 2, 2); Middle.setRotationPoint(0F, 0F, 0F); Middle.setTextureSize(64, 64); Middle.mirror = true; setRotation(Middle, 0F, 0F, 0F); Tip = new ModelRenderer(this, 2, 2); Tip.addBox(-1F, -1F, -1F, 2, 2, 1); Tip.setRotationPoint(0F, 0F, -6F); Tip.setTextureSize(64, 64); Tip.mirror = true; setRotation(Tip, 0F, 0F, 0F); End = new ModelRenderer(this, 2, 24); End.addBox(-2F, -2F, 0F, 4, 4, 1); End.setRotationPoint(0F, 0F, 2F); End.setTextureSize(64, 64); End.mirror = true; setRotation(End, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5); Front.render(f5); Middle.render(f5); Tip.render(f5); End.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) { super.setRotationAngles(f, f1, f2, f3, f4, f5, null); } } Load Method (Main Class) EntityRegistry.registerGlobalEntityID(EntityRocket.class, "Rocket", 21); RenderingRegistry.registerEntityRenderingHandler(EntityRocket.class, new RenderRocket(new RocketModel(), 0.1F));
  11. Umm Help? AGAIN... It's still somehow doing the glitch... D:< Anywayz... Here is the code in the register line: EntityRegistry.registerGlobalEntityID(EntitySquishy.class, "Squishy", 22); EntityRegistry.addSpawn(EntitySquishy.class, 1, 1, 1, EnumCreatureType.monster); EntityRegistry.findGlobalUniqueEntityId(); registerEntityEgg(EntitySquishy.class, 0x7F6A00 , 0xFFBC42); RenderingRegistry.registerEntityRenderingHandler(EntitySquishy.class, new RenderSquishy(new SquishyModel(), 1.0F)); LanguageRegistry.instance().addStringLocalization("entity.Squishy.name", "Squishy");
  12. I already added that to my Entity File(Under the Tasks method), but it's still moving VERY sllow
  13. I read the part you crossed out... It actually is summoned via Item... So how do I actually play the music with the item?
  14. Can you tell me the code on how to do that exactly... thnx in advanced
  15. Anyone know how a mob can play music RIGHT when it spawns... and upon death, the music stops... So far I only have 2 boss mobs, but this is still very important to me! I am aware of the .playSoundatEntity and the onDeath... BUT I DONT EXACTLY KNOW HOW TO CONSTRUCT THE CODE!
  16. It's better if you use the unlocalized name... It's WAY easier...even for me! Replace your this.itemIcon with this: this.itemIcon = reg.registerIcon(YOURMOD.modid + ":" + this.getUnlocalizedName()); Add this to your item registry(Main class) EXAMPLE: ItemYOURITEM = new ItemYOURITEM(5004).setUnlocalizedName("UNLOCALIZED NAME").setCreativeTab(YOURTABTab); LanguageRegistry.addName(ItemYOURITEM, "In-Game-Name"); After that... Do this with your item.png: item.UNLOCALIZEDNAME.png So all you have to do is paste in your Unlocalized name you wrote down in the registry. (The unlocalized name can be whatever you want... Just remember it for the .png)
  17. For some odd reason... my mobs MOVE VERY SLOW. I set my this.setAIMoveSpeed() to 1.0F (AND THAT'S FAST). Now when I'm in-game... sometimes, the mobs actually move at a fast pace, but they teleport to their previous location, as if it was the server lagging. Here is my entitymob code: package assets.cutiesmod.entity; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.ai.EntityAIAttackOnCollide; import net.minecraft.entity.ai.EntityAIBreakDoor; import net.minecraft.entity.ai.EntityAIHurtByTarget; import net.minecraft.entity.ai.EntityAILeapAtTarget; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAIMoveThroughVillage; import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.boss.IBossDisplayData; import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.monster.EntitySlime; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.world.World; import assets.cutiesmod.common.CutiesMod; public class EntitySquishy extends EntityMob implements IBossDisplayData { public EntitySquishy(World par1World) { super(par1World); this.setAIMoveSpeed(1.0F); this.isImmuneToFire = true; this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAILeapAtTarget(this, 0.4F)); this.tasks.addTask(0, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); this.tasks.addTask(0, new EntityAIAttackOnCollide(this, EntityMaleCutie.class, 1.0D, true)); this.tasks.addTask(2, new EntityAIMoveTowardsRestriction(this, 1.0D)); this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 1.0D, false)); this.tasks.addTask(4, new EntityAIWander(this, 1.0D)); this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(5, new EntityAILookIdle(this)); this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityMaleCutie.class, 0, false)); } public int getMaxHealth() { return 500; } public int getMaxDamage() { return 16; } protected void dropFewItems(boolean par1, int par2) { int j = this.rand.nextInt(2 + par2); int k; for (k = 0; k < j; ++k) { this.dropItem(CutiesMod.ItemCutieSoul.itemID, 4); } j = this.rand.nextInt(2 + par2); for (k = 0; k < j; ++k) { this.dropItem(Item.slimeBall.itemID, 10); } } public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.UNDEAD; } protected String getLivingSound() { return "mob.enderdragon.growl"; } /** * Returns the sound this mob makes when it is hurt. */ protected String getHurtSound() { return "mob.enderdragon.hit"; } /** * Returns the sound this mob makes on death. */ protected String getDeathSound() { return "mob.wither.death"; } } All of my mobs do this... BUT I DON'T KNOW WHY!
  18. The only major change is the RenderYOURMOB class. The texture directory is now writen there, and THERE IS A WHOLE DIFFERENT WAY OF RENDERING! For those of you who have "invisible" mobs. HERE: package assets.cutiesmod.render; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import assets.cutiesmod.common.CutiesMod; import assets.cutiesmod.entity.EntityMaleCutie; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class RenderYOURMOB extends RenderLiving { public static final ResourceLocation Texture = new ResourceLocation(YOURMOD.modid, "/textures/entity/YOURMOB.png"); public RenderYOURMOB(ModelBase par1ModelBase, float par2) { super(par1ModelBase, par2); } protected ResourceLocation func_110832_a(EntityYOURMOB par1EntityYOURMOB) { return Texture; } protected ResourceLocation func_110775_a(Entity par1Entity) { return this.func_110832_a((EntityYOURMOB)par1Entity); } }
  19. Thnx and... lol... I will be posting the mod soon, and why it's called "Cutie"
  20. I've followed the old code for mobs (1.5.2) and I've noticed a glitch with the Egg WHAT NAME SHOWS UP (on the egg): Spawn.entity.Cutie.name Here is the register code for the mob: EntityRegistry.addSpawn(EntityMaleCutie.class, 6, 2, 4, EnumCreatureType.creature); EntityRegistry.findGlobalUniqueEntityId(); registerEntityEgg(EntityMaleCutie.class, 0x00B6ED , 0xFFDA45); RenderingRegistry.registerEntityRenderingHandler(EntityMaleCutie.class, new RenderMaleCutie(new MaleCutieModel(), 0.3F));
  21. Got it! All I had to do was copy the EntityEgg (Chicken Egg) and make my own Entity with the egg code: For those of you who want to summon mobs... HERE: 1.REPLACE "Squishy" WITH YOUR MOB/ITEM: 2. Make your Spawner Item: package assets.cutiesmod.common; public class ItemSquishySpawner extends Item { public ItemSquishySpawner(int id) { super(id); this.setMaxStackSize(64); this.setCreativeTab(CreativeTabs.tabMaterials); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister reg) { this.itemIcon = reg.registerIcon(CutiesMod.modid + ":" + this.getUnlocalizedName()); } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (!par3EntityPlayer.capabilities.isCreativeMode) { --par1ItemStack.stackSize; } par2World.playSoundAtEntity(par3EntityPlayer, "mob.wither.spawn", 0.5F, 0.4F); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntitySquishySpawner(par2World, par3EntityPlayer)); } return par1ItemStack; } } ==========================================================Here is the Entity for the SpawnerItem: Basically copied from the EntityEgg, removed the code that allows the egg to RARELY SPAWN THE MOB package assets.cutiesmod.entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.passive.EntityChicken; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class EntitySquishySpawner extends EntityThrowable { public EntitySquishySpawner(World par1World) { super(par1World); } public EntitySquishySpawner(World par1World, EntityLivingBase par2EntityLivingBase) { super(par1World, par2EntityLivingBase); } public EntitySquishySpawner(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6); } /** * Called when this EntityThrowable hits a block or entity. */ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { if (par1MovingObjectPosition.entityHit != null) { par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); } YOUR_ENTITY entity = new YOUR_ENTITY (this.worldObj); entity.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); this.worldObj.spawnEntityInWorld(entity); for (int j = 0; j < 8; ++j) { this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); } if (!this.worldObj.isRemote) { this.setDead(); } } }
  22. Sure, Here: EntitySquishy: package assets.cutiesmod.entity; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.ai.EntityAIAttackOnCollide; import net.minecraft.entity.ai.EntityAIBreakDoor; import net.minecraft.entity.ai.EntityAIHurtByTarget; import net.minecraft.entity.ai.EntityAILeapAtTarget; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAIMoveThroughVillage; import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.boss.IBossDisplayData; import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.monster.EntitySlime; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.world.World; import assets.cutiesmod.common.CutiesMod; public class EntitySquishy extends EntityMob implements IBossDisplayData { public static final String[] field_110268_bz = new String[] { "/cutiesmod/textures/entity/EntityHellCutie.png" }; public EntitySquishy(World par1World) { super(par1World); this.setAIMoveSpeed(1.0F); this.isImmuneToFire = true; this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAILeapAtTarget(this, 0.4F)); this.tasks.addTask(0, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); this.tasks.addTask(0, new EntityAIAttackOnCollide(this, EntityMaleCutie.class, 1.0D, true)); this.tasks.addTask(2, new EntityAIMoveTowardsRestriction(this, 1.0D)); this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 1.0D, false)); this.tasks.addTask(4, new EntityAIWander(this, 1.0D)); this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(5, new EntityAILookIdle(this)); this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityMaleCutie.class, 0, false)); } public int getMaxHealth() { return 500; } public int getMaxDamage() { return 16; } protected void dropFewItems(boolean par1, int par2) { int j = this.rand.nextInt(2 + par2); int k; for (k = 0; k < j; ++k) { this.dropItem(CutiesMod.ItemCutieSoul.itemID, 4); } j = this.rand.nextInt(2 + par2); for (k = 0; k < j; ++k) { this.dropItem(Item.slimeBall.itemID, 10); } } public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.UNDEAD; } protected String getLivingSound() { return "mob.enderdragon.growl"; } /** * Returns the sound this mob makes when it is hurt. */ protected String getHurtSound() { return "mob.enderdragon.hit"; } /** * Returns the sound this mob makes on death. */ protected String getDeathSound() { return "mob.wither.death"; } }
  23. Couldn't really find the spawnegg code... so I tried the ItemSnowball, since it spawns the entity: Snowball. I've changed a couple of variables, like replacing the EntitySnowball being spawned to the mob i want. Thing is, it works... but for some odd reason the mob is invisible? I have a spawnegg for the same mob... it works and everything, but using the Item instead of the egg, does nothing... Boss name: Squishy Here is the code: ItemSquishySpawner: import cpw.mods.fml.relauncher.SideOnly; public class ItemSquishySpawner extends Item { public ItemSquishySpawner(int id) { super(id); this.setMaxStackSize(64); this.setCreativeTab(CreativeTabs.tabMaterials); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister reg) { this.itemIcon = reg.registerIcon(CutiesMod.modid + ":" + this.getUnlocalizedName()); } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (!par3EntityPlayer.capabilities.isCreativeMode) { --par1ItemStack.stackSize; } par2World.playSoundAtEntity(par3EntityPlayer, "mob.wither.spawn", 0.5F, 0.4F); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntitySquishy(par2World)); } return par1ItemStack; } ==========================================================Help?
  24. Hey, I'm kinda new to java code, but I have this mob that I want to be summoned/spawned with an item besides the spawn egg. For Example: If i right click a stick... it could summon a wolf or somethin... This is VERY important for my mod... The bosses in my mod REALLY beef up the contents in mah mod!!!

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.