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.

Bedrock_Miner

Forge Modder
  • Joined

  • Last visited

Everything posted by Bedrock_Miner

  1. Yes, I'm trying to do a lot... I'll try all the possibilities you mentioned (THANKS) and come back with errors PS: I've got a laarge project... I've been planning this for two months now...
  2. I want to set the players maximum life to 250, so I have to make the Weapons and Normal Attacks stronger. How can I do this without changing base classes? And how can I create Submods or something to make weapons from other mods stronger too, so it stays compatible? Thanks in advance!
  3. I want to add a new achievement System to my Mod, similar to the "Thaumonomicum" in Thaumcraft. I couldn't decompile Thaumcraft, so I'm asking this Question... Can anybody help me? Thanks in Advance!
  4. Hello Guys! I want to add a Mana-bar available for each player. It should have a maximum value of 250 Mana and should be rendered above the hunger-bar. The Mana bar should regenerate by one each second and should be increased by about 20 for each punch with a sword. Does anybody know, how to do this? Additional question: How can I change the maximum Player Health to 250 and how can I change the Armor-calculator (I want to use another Formula then Armor*0.04)? Please ask, if I should give further information!
  5. If you don't want to create a new class for every single Block or Item, do it like this: Hope, I could help you.
  6. You should remove this lines of code from your common Proxy. Neither rendering nor Armordeclarations are needed from server side. public void registerRenderer() { } public int addArmor(String string){ return 0; } You can leave your commonProxy blank. Everything important (rendering, Armor-Renderer) is in the client proxy.
  7. I think you don't need the <modid>:... Try it the following way: You create this Item with this code: Client Proxy: (The common Proxy is Emty, rendering is only client stuff) I hope this will work at 1.6.2 too, I tried it only with 1.5.2 Hope I could help you.
  8. I want to log in in the Eclipse-Minecraft (Modding state) with my normal minecraft account. With the 1.5.2 version it worked fine: Run Configuration -> Arguments " <MC-Loginname> <Password> " Now, in 1.6.2 this doesn't work anymore. The default arguments are: --version 1.6 --tweakClass cpw.mods.fml.common.launcher.FMLTweaker What can I do to log in with my own account? Thanks in advance!
  9. Thanks very much! It works well...
  10. I think the title tells everything... I want to create a mod which should support different languages. Should I do this with a config file or with language-files? And how do I create them? Thanks in advance!
  11. Does no one have an Idea?! If so, you could tell me another way to create multiple Entities of the same Type (My Shurikens are like Snowballs) with different render Icons... Please help me!
  12. The Entities have the same texture. The Items are all different. The spawned Entities are different too, it's only the same texture.
  13. The last problem is solved, directly after this the next one comes up: My shurikens are all rendered same; all of them have the same texture... What have I done wrong? The corresponding Item class: The Intialzation of these Items: The EntityShurkien Class: The Render Class: And last but not least the initialization of the renderer: I hope, somebody can help me with this problem... Thanks in advance!!! (If you need more source code, please tell me!)
  14. Yeah! That solved it (but I really don't know why ) @Draco: I looked in EntityArrow, there its solved quite different (and does'n work either, I'm just too stupid. ) But thanks to both of you!
  15. Hi Guys! I've created some Shurikens in minecraft. Everything works well, except the following: I want the shurikens to drop as an Item if they hit the ground. The problem is: Sometimes not one but two Items are dropped. And sometimes an Item is dropped even if I hit an Entity, like a Creeper or something! I found out that the method is called multiple times (I replaced the dropItem with an Output line). But how can this go on? The Entity is killed at the end of the method, so it musnt't be called again. I have no Idea why. Can you help me? Register Class: public static void registerEntities() { EntityRegistry.registerGlobalEntityID(EntityShuriken.class, "Shuriken", EntityRegistry.findGlobalUniqueEntityId()); EntityRegistry.registerModEntity(EntityShuriken.class, "Shuriken", 0, MoreTools.instance, 128, 1, true); RenderingRegistry.registerEntityRenderingHandler(EntityShuriken.class, new RenderShuriken(MoreToolsItems.shurikenIron)); } Entity Class: (copied from entityy Snowball (and edited)) package Bedrockminer.MoreTools.Classes; import Bedrockminer.MoreTools.Declarations.MoreToolsItems; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class EntityShuriken extends EntityThrowable { public EntityShuriken(World par1World) { super(par1World); } public EntityShuriken(World par1World, EntityLiving par2EntityLiving) { super(par1World, par2EntityLiving); } public EntityShuriken(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) { byte b0 = 5; par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), b0); } else { this.dropItem(MoreToolsItems.shurikenIron.itemID, 1); } this.setDead(); } } Item Class: package Bedrockminer.MoreTools.Classes; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class MoreToolsShuriken extends Item { private boolean shotalready; public MoreToolsShuriken(int par1) { super(par1); } public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ EntityShuriken shuriken = new EntityShuriken(world, player); world.playSoundAtEntity(player, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + 0.5F); if (!world.isRemote) { world.spawnEntityInWorld(shuriken); } if (!player.capabilities.isCreativeMode){ if (-- stack.stackSize == 0) return null; } return stack; } } Render Class: (copied from Snowballs) package Bedrockminer.MoreTools.Classes; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.entity.projectile.EntityPotion; import net.minecraft.item.Item; import net.minecraft.item.ItemPotion; import net.minecraft.potion.PotionHelper; import net.minecraft.util.Icon; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; @SideOnly(Side.CLIENT) public class RenderShuriken extends Render { private Item field_94151_a; private int field_94150_f; public RenderShuriken(Item par1, int par2) { this.field_94151_a = par1; this.field_94150_f = par2; } public RenderShuriken(Item par1) { this(par1, 0); } /** * 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 probabilty, the class Render is generic * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1, * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. */ public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { Icon icon = this.field_94151_a.getIconFromDamage(this.field_94150_f); if (icon != null) { GL11.glPushMatrix(); GL11.glTranslatef((float)par2, (float)par4, (float)par6); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glScalef(0.5F, 0.5F, 0.5F); this.loadTexture("/gui/items.png"); Tessellator tessellator = Tessellator.instance; if (icon == ItemPotion.func_94589_d("potion_splash")) { int i = PotionHelper.func_77915_a(((EntityPotion)par1Entity).getPotionDamage(), false); float f2 = (float)(i >> 16 & 255) / 255.0F; float f3 = (float)(i >> 8 & 255) / 255.0F; float f4 = (float)(i & 255) / 255.0F; GL11.glColor3f(f2, f3, f4); GL11.glPushMatrix(); this.func_77026_a(tessellator, ItemPotion.func_94589_d("potion_contents")); GL11.glPopMatrix(); GL11.glColor3f(1.0F, 1.0F, 1.0F); } this.func_77026_a(tessellator, icon); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); } } private void func_77026_a(Tessellator par1Tessellator, Icon par2Icon) { float f = par2Icon.getMinU(); float f1 = par2Icon.getMaxU(); float f2 = par2Icon.getMinV(); float f3 = par2Icon.getMaxV(); float f4 = 1.0F; float f5 = 0.5F; float f6 = 0.25F; GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3); par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3); par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2); par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2); par1Tessellator.draw(); } } PS: If anybody tried it out with my code and it works, please tell me what exactly you did!
  16. If anybody has made Mods who do nearly the same, I would be very greatful, if I could see the source code...
  17. Really, that solved it! Weird, in my opinion... Thank you!
  18. I don't think, anything is called twice, because I copied all from the EntityArrow class (This caused, that the shurikens are too long ) And I really don't know, which of these cryptical named Variables are the right to change... Also I don't know the fireball glitch, you pointed out... Have you tried it out, or do you suggest about errors?
  19. Maybe, you can show me the source of a Mod, with makes shurikens as well. If I can see a working Code, I mayybe find my Errors. And something else: I think, I could understand the Render-Method better (and maybe find errors) if Somebody tell me what function all the Parameters and Variables have, because their name (par1...) don't help me at all. You also can try the code and tell me whether it worked...
  20. Hello Guys! When I create some new Items which should have the same texture, not only the texture but the name is the same. Every Item is named after the one which was added last. Why is this? (I got this error when I created my landmines with an own Class..) Main: landmine = new BlockLandmine(landmineID, "tnt_side", EnumMobType.mobs, true).setCreativeTab(MoreTools.tabMoreTools).setHardness(0.5F); playerLandmine = new BlockLandmine(playerLandmineID, "tnt_side", EnumMobType.players, true).setCreativeTab(MoreTools.tabMoreTools).setHardness(0.5F); nailBomb = new BlockLandmine(nailBombID, "tnt_side", EnumMobType.mobs, false).setCreativeTab(MoreTools.tabMoreTools).setHardness(0.5F); playerNailBomb = new BlockLandmine(playerNailBombID, "tnt_side", EnumMobType.players, false).setCreativeTab(MoreTools.tabMoreTools).setHardness(0.5F); GameRegistry.registerBlock(landmine, "Landmine"); GameRegistry.registerBlock(playerLandmine, "Player Landmine"); GameRegistry.registerBlock(playerNailBomb, "Player Nailbomb"); GameRegistry.registerBlock(nailBomb, "Nailbomb"); LanguageRegistry.addName(landmine,"Landmine"); LanguageRegistry.addName(playerLandmine, "Player Landmine"); LanguageRegistry.addName(playerNailBomb,"Player Nail Bomb"); LanguageRegistry.addName(nailBomb, "Nailbomb"); BlockLandmine: package Bedrockminer.MoreTools.Classes; import java.util.Iterator; import java.util.List; import net.minecraft.block.*; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockLandmine extends BlockBasePressurePlate { protected BlockLandmine(int par1, String par2Str, Material par3Material) { super(par1, par2Str, par3Material); } /** The mob type that can trigger this pressure plate. */ private EnumMobType triggerMobType; private EntityLiving EntityLiving; private boolean destroysBlocks; private String pictureName; public BlockLandmine(int par1, String par2Str, EnumMobType par4EnumMobType, boolean destroysStructures) { super(par1, par2Str, Material.wood); this.triggerMobType = par4EnumMobType; this.destroysBlocks = destroysStructures; } /** * Returns the current state of the pressure plate. Returns a value between 0 and * 15 based on the number of items on it. */ protected int getPlateState(World par1World, int X, int Y, int Z) { List list = null; if (this.triggerMobType == EnumMobType.everything) { list = par1World.getEntitiesWithinAABBExcludingEntity((Entity)null, this.getSensitiveAABB(X, Y, Z)); } if (this.triggerMobType == EnumMobType.mobs) { list = par1World.getEntitiesWithinAABB(EntityLiving.class, this.getSensitiveAABB(X, Y, Z)); } if (this.triggerMobType == EnumMobType.players) { list = par1World.getEntitiesWithinAABB(EntityPlayer.class, this.getSensitiveAABB(X, Y, Z)); } if (!list.isEmpty()) { Iterator iterator = list.iterator(); while (iterator.hasNext()) { Entity entity = (Entity)iterator.next(); if (!entity.doesEntityNotTriggerPressurePlate()) { explode(par1World, X, Y, Z); //Explodes if somebody steps on it. } } } return 0; } public void onBlockPlacedBy(World world, int X, int Y, int Z, EntityLiving placedby, ItemStack stack){ this.EntityLiving = placedby; } public void onBlockDestroyedByExplosion(World world, int X, int Y, int Z, Explosion expl){ explode(world, X, Y, Z); //Explodes if blown up by another mine, TNT or a creeper } private void explode(World world, int X, int Y, int Z){ world.setBlockToAir(X, Y, Z); world.createExplosion(null, X, Y, Z, 2.6F, this.destroysBlocks); } @Override protected int getPowerSupply(int i) { return 0; } @Override protected int getMetaFromWeight(int i) { return 0; } /** * hides itself, it takes the texture from the Block below */ @Override public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) { int idBelow = world.getBlockId(x, y - 1, z); if (Block.blocksList[idBelow] != null) { return Block.blocksList[idBelow].getBlockTexture(world, x, y - 1, z, side); } else { return blockIcon;// fallback if no block below for some reason } } public int colorMultiplier(IBlockAccess world, int x, int y, int z){ Block block = Block.blocksList[world.getBlockId(x, y-1, z)]; if(block != null) return block.colorMultiplier(world, x, y-1, z); else return super.colorMultiplier(world, x, y-1, z); } public boolean canPlaceBlockAt(World world, int par2, int par3, int par4) { return world.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || BlockFence.isIdAFence(world.getBlockId(par2, par3 - 1, par4)) || world.getBlockId(par2, par3 -1, par4) == Block.glass.blockID || world.getBlockId(par2, par3 -1, par4) == Block.glowStone.blockID; } } If you know, what the error is or if you don't have any Error, please tell me. Thanks in advance!
  21. OK, now I got it. Thank you very much, it works well! [move] :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) [/move]
  22. Sorry, but I just don't get it right. The method colorMultiplier has got an integer value as return type, but I need an Icon. How can I manage this? public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) { int idBelow = world.getBlockId(x, y - 1, z); if (Block.blocksList[idBelow] != null) { return Block.blocksList[idBelow].getBlockTexture(world, x, y - 1, z, side); } else { return blockIcon;// fallback if no block below for some reason } } (I've used the old code, because your returns a normal dirt texture on a grass Block) @ColdFox: The explosions work now

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.