Jump to content

Thor597

Forge Modder
  • Posts

    268
  • Joined

  • Last visited

Everything posted by Thor597

  1. I have already tried setBlockAndMetadataWithNotify it doesnt work, and I cant put it a damage value...
  2. Ok, so I have the code set up and I figured out one of the things which is how to make a block turn into a metadata block; But what I need is to make a metadata block turn into another metadata block public boolean onItemUse( ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7) { if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6)) { return false; } int i = par3World.getBlockId(par4, par5, par6); if (par5 != 0 && i == BlockThatGetsChangedIntoTheBlockBelowAndThatNeedsToHaveADamageValue.blockID) { Block block = BlockThatGetsPutInWorldWhenYouRightClickBlockAboveThisOneAlreadyHasMetadata; par3World.playSoundEffect((float)par4 + 0.5F, (float)par5 + 0.5F, (float)par6 + 0.5F, block.stepSound.getStepSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); if (par3World.isRemote) { return true; } else { par3World.setBlockAndMetadataWithNotify(par4, par5, par6, block.blockID, 5); <The int at the end of this is the damage value par1ItemStack.damageItem(1, par2EntityPlayer); return true; } So basically I need the block: BlockThatGetsChangedIntoTheBlockBelowAndThatNeedsToBeAMetadataBlock.blockID to be able to have a damage value! Thanks for reading, please help!
  3. I found the problem and everything is working smoothly now, what I did wrong: 1. My class was implementing ISoundHandler 2. I didnt have onPlaySoundAtEntity() in my class 3. I was using .ogg files not wav files Thank you!
  4. Oh ok
  5. Who posted? I still dont see any answers to this problem. Nothing works with the registerSoundHandler thing no matter what I put in there it always says cannot instantiate <The Thing You Put In The Brackets>. Also, what do I put in the getLivingSound thing on mobs when I want to use the sound?
  6. Would be nice if you could send us what you did so we know what we've done wrong, thank you very much
  7. I dont understand the MinecraftForgeClient.registerSoundHandler(new SoundHandlerClass()); thing, I try this but it doesnt work: MinecraftForgeClient.registerSoundHandler(new ThorMod_SoundHandler()); Eclipse gives me the error: Cannot instantiate the type ThorMod_SoundHandler ThorMod_SoundHandler: package net.minecraft.src; import java.io.File; import java.lang.reflect.Method; import java.net.URL; import java.net.URLClassLoader; import net.minecraft.src.ModLoader; import net.minecraft.src.SoundManager; import net.minecraft.src.SoundPoolEntry; import net.minecraft.src.mod_TheThorMod; import net.minecraft.src.forge.*; public abstract class ThorMod_SoundHandler implements ISoundHandler { @Override public void onSetupAudio(SoundManager soundManager) { } @Override public void onLoadSoundSettings(SoundManager soundManager) { String [] soundFiles = { "monkey/cry1.ogg", "monkey/cry2.ogg", "monkey/cry3.ogg",}; for (int i = 0; i < soundFiles.length; i++){ soundManager.getSoundsPool().addSound(soundFiles[i], this.getClass().getResource("/Thormod/Audio/" + soundFiles[i])); } } @Override public SoundPoolEntry onPlayBackgroundMusic(SoundManager soundManager, SoundPoolEntry entry) { return entry; } @Override public SoundPoolEntry onPlayStreaming(SoundManager soundManager, SoundPoolEntry entry, String soundName, float x, float y, float z) { return entry; } @Override public SoundPoolEntry onPlaySound(SoundManager soundManager, SoundPoolEntry entry, String soundName, float x, float y, float z, float volume, float pitch) { return entry; } @Override public SoundPoolEntry onPlaySoundEffect(SoundManager soundManager, SoundPoolEntry entry, String soundName, float volume, float pitch) { return entry; } } Pls help I need this
  8. My recipe: ModLoader.addShapelessRecipe(new ItemStack(DecPlanks, 4, 2),new Object[]{ Block.planks,Block.planks,Block.planks,Block.planks, Item.axeGold }); I can only use the golden axe once in the recipe, because when its damaged after the first time I use it in the recipe Its not new hence I cant use it anymore this is very frustrating. btw JKK, because you got it working, can you please help me out? I need this! Thank you!
  9. How do I use java reflection in minecraft code to help me do this then? Please help me D:
  10. Did you read the topic name HOW TO ADD ITEM DROPS TO VANILLA BLOCKS WITHOUT EDITING BASE CLASSES LIKE MAKING ICE DROP SOMETHING WITHOUT EDITING BLOCKICE.JAVA
  11. Oh trust me I've searched for tutorials a looot, There is actually no-one I can find that does this. And when I search up something like this post name on google all I find is people that says its impossible
  12. If you don't understand how that could be helpful, then you are probably copy / paste "modding"... By not help me in this situation I mean it wont help me as I dont know how to use that to make vanilla blocks drop something. How do I use that in minecraft code?
  13. I am sorry but I didnt quite understand how that could help me in this particular situation, im a relatively new modder can you give me an excample of how this is used in the way I stated in the post above? Thank you!
  14. There should be a a method to add item drops to vanilla blocks in forge so that your mod isnt incompatible with other mods that edits the same blocks, something like: MinecraftForge.addItemDrop(Block, DroppedItem) this would be really nice!
  15. But when the item is damaged you cant use it in a crafting recipe again? how do I fix this?
  16. I was wondering if there was a way to make vanilla blocks drop items without editing the block file. In my case I want to make ice drop salt (from my mod) at a 1-10 chance without editing BlockIce, is there a way to do this?
  17. Recompiling didnt work either. im confused
  18. Didnt work, do i have to recompile?
  19. Do you mean mcmod.info? and placed inside the minecraft.jar in the jars folder?
×
×
  • Create New...

Important Information

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