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.

SkyGuard1

Members
  • Joined

  • Last visited

Everything posted by SkyGuard1

  1. Shouldn't your EntityNuclearTntPrimed extend EntityTntPrimed?
  2. But how do you set rarity to a custom drop?
  3. @diesieben07 Fine... I'll do it myself
  4. Oh... Its the only version I know how to code though... Can you make an exception, though?
  5. I am trying to add custom drops to vanilla mobs. Does anyone know how to set the rarity of a drop? Replies would be very helpful.
  6. OK I will try it for a few days and watch some YouTube tutorials.
  7. 1.8 is the easiest version to write mods for me anyways. I don't know how to do this 1.11-1.12.2 stuff.
  8. Why use 1.8.9, though?
  9. Its the block. The entity looks like a normal TNT block.
  10. BTW this is 1.8
  11. Well too bad! BTW i have my own problem : I am trying to make a custom tnt and my textures dont work. Can anyone help?
  12. Is there an event for thrown entities?
  13. Help! I am trying to make a custom TNT block and my texture isnt working. Heres my Block class: package sg1Dev.TUTmod.blocks; import net.minecraft.block.BlockTNT; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityTNTPrimed; import net.minecraft.util.BlockPos; import net.minecraft.world.Explosion; import net.minecraft.world.World; import sg1Dev.TUTmod.YTTM; import sg1Dev.TUTmod.world.EntityTestTNTPrimed; public class BlockTestTNT extends BlockTNT { public BlockTestTNT() { setHardness(0.0f); setHardness(2F); setResistance(3F); setStepSound(soundTypeGrass); setCreativeTab(YTTM.tabTutorial); } /** * Called upon the block being destroyed by an explosion */ @Override public void onBlockDestroyedByExplosion(World par1World, BlockPos pos, Explosion par5Explosion) { if(!par1World.isRemote) { EntityTestTNTPrimed entitytntprimed = new EntityTestTNTPrimed(par1World, (double) ((float) pos.getX() + 0.5F), (double) ((float) pos.getY() + 0.5F), (double) ((float) pos.getZ() + 0.5F), par5Explosion.getExplosivePlacedBy()); entitytntprimed.fuse = par1World.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8; par1World.spawnEntityInWorld(entitytntprimed); } } /** * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData */ @Override public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) { this.explode(worldIn, pos, state, (EntityLivingBase) null); } public void explode(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase igniter) { if(!worldIn.isRemote) { if(((Boolean) state.getValue(EXPLODE)).booleanValue()) { EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double) ((float) pos.getX() + 0.5F), (double) ((float) pos.getY() + 0.5F), (double) ((float) pos.getZ() + 0.5F), igniter); worldIn.spawnEntityInWorld(entitytntprimed); worldIn.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F); } } } } Heres my Entity class: package sg1Dev.TUTmod.world; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityTNTPrimed; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; public class EntityTestTNTPrimed extends EntityTNTPrimed { private EntityLivingBase tntPlacedBy; public EntityTestTNTPrimed(World worldIn) { super(worldIn); } public EntityTestTNTPrimed(World worldIn, double p_i1730_2_, double p_i1730_4_, double p_i1730_6_, EntityLivingBase entity) { this(worldIn); this.fuse = 85; this.tntPlacedBy = entity; } /** * Called to update the entity's position/logic */ public void onUpdate() { this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; this.motionY -= 0.03999999910593033D; this.moveEntity(this.motionX, this.motionY, this.motionZ); this.motionX *= 0.9800000190734863D; this.motionY *= 0.9800000190734863D; this.motionZ *= 0.9800000190734863D; if(this.onGround) { this.motionX *= 0.699999988079071D; this.motionZ *= 0.699999988079071D; this.motionY *= 0.5D; } if(this.fuse-- <= 0) { this.setDead(); if(!this.worldObj.isRemote) { this.explode(); } } else { this.handleWaterMovement(); this.worldObj.spawnParticle(EnumParticleTypes.NOTE, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); } } private void explode() { float f = 8.0F; this.worldObj.createExplosion(this, this.posX, this.posY + (double) (this.height / 2.0F), this.posZ, f, true); } /** * (abstract) Protected helper method to read subclass entity data from NBT. */ protected void readEntityFromNBT(NBTTagCompound tagCompound) { this.fuse = tagCompound.getByte("Fuse"); } /** * returns null or the entityliving it was placed or ignited by */ public EntityLivingBase getTntPlacedBy() { return this.tntPlacedBy; } } and my render class: package sg1Dev.TUTmod.util; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BlockRendererDispatcher; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderTNTPrimed; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityTNTPrimed; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import sg1Dev.TUTmod.YTTM; import sg1Dev.TUTmod.world.EntityTestTNTPrimed; @SideOnly(Side.CLIENT) public class RenderTestTNTPrimed extends RenderTNTPrimed { public RenderTestTNTPrimed(RenderManager p_i46134_1_) { super(p_i46134_1_); this.shadowSize = 0.5F; } /** * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then * handing it off to a worker function which does the actual work. In all probability, the calss Render is generic * (Render<T extends Entity>) and this method has signature public void func_76986_a(T entity, double d, double d1, * double d2, float f, float f1). But JAD is pre 1.5 so doe */ public void doRender(EntityTNTPrimed entity, double x, double y, double z, float f, float partialTicks) { BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); GlStateManager.pushMatrix(); GlStateManager.translate((float)x, (float)y + 0.5F, (float)z); float f2; if((float)entity.fuse - partialTicks + 1.F < 10.0F) { f2 = (float) (1.0 - ((float)entity.fuse - partialTicks + 1.0F) / 10.0F); f2 = MathHelper.clamp_float(f2, 0.0F, 1.0F); f2 *= f2; f2 *= f2; float f3 = 1.0f + f2 * 0.3F; GlStateManager.scale(f3, f3, f3); } f2 = (1.0F - ((float)entity.fuse - partialTicks + 1.0F) / 100.0F) * 0.8F; this.bindEntityTexture(entity); GlStateManager.translate(-0.5F, -0.5F, 0.5F); blockrendererdispatcher.renderBlockBrightness(YTTM.testTNT.getDefaultState(), entity.getBrightness(partialTicks)); GlStateManager.translate(0.0F, 0.0F, 1.0F); if (entity.fuse / 5 % 2 == 0) { GlStateManager.disableTexture2D(); GlStateManager.disableLighting(); GlStateManager.enableBlend(); GlStateManager.blendFunc(770, 772); GlStateManager.color(1.0F, 1.0F, 1.0F, f2); GlStateManager.doPolygonOffset(-3.0F, -3.0F); GlStateManager.enablePolygonOffset(); blockrendererdispatcher.renderBlockBrightness(YTTM.testTNT.getDefaultState(), 1.0F); GlStateManager.doPolygonOffset(0.0F, 0.0F); GlStateManager.disablePolygonOffset(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.disableBlend(); GlStateManager.enableLighting(); GlStateManager.enableTexture2D(); } GlStateManager.popMatrix(); super.doRender(entity, x, y, z, f, partialTicks); } protected ResourceLocation func_180563_a(EntityTestTNTPrimed tntPrimed) { return TextureMap.locationBlocksTexture; } protected ResourceLocation getEntityTexture(Entity entity) { return this.func_180563_a((EntityTestTNTPrimed)entity); } public void doRender(Entity entity, double x, double y, double z, float p_76986_8_, float partialTicks) { this.doRender((EntityTestTNTPrimed)entity, x, y, z, p_76986_8_, partialTicks); } } my Blockstates json: { "variants": { "normal": [ { "model": "yt_tm:blocks/test_tnt" }, { "model": "yt_tm:blocks/test_tnt", "y": 90 }, { "model": "yt_tm:blocks/test_tnt", "y": 180 }, { "model": "yt_tm:blocks/test_tnt", "y": 270 } ] } } and Block JSON: { "parent": "block/cube_bottom_top", "textures": { "bottom": "yt_tm:blocks/test_tnt_bottom", "top": "yt_tm:blocks/test_tnt_top", "side": "yt_tm:blocks/test_tnt_side" } } an anyone help?
  14. yeah i started over and barely added an item and it worked
  15. what do you mean? I'm a starter to modding so I partly don't know what I'm doing
  16. hey i have a problem too it says: "execution failed for task ':reobf' Java Heap Space Can you help imusing java 1.8 and forge 1.8

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.