
Thor597
Forge Modder-
Posts
268 -
Joined
-
Last visited
Everything posted by Thor597
-
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!
-
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!
-
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?
-
Would be nice if you could send us what you did so we know what we've done wrong, thank you very much
-
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
-
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!
-
Making vanilla blocks drop items without editing base classes
Thor597 replied to Thor597's topic in General Discussion
How do I use java reflection in minecraft code to help me do this then? Please help me D: -
Making vanilla blocks drop items without editing base classes
Thor597 replied to Thor597's topic in General Discussion
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 -
Making vanilla blocks drop items without editing base classes
Thor597 replied to Thor597's topic in General Discussion
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 -
Making vanilla blocks drop items without editing base classes
Thor597 replied to Thor597's topic in General Discussion
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? -
Making vanilla blocks drop items without editing base classes
Thor597 replied to Thor597's topic in General Discussion
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! -
Making vanilla blocks drop items without editing base classes
Thor597 replied to Thor597's topic in General Discussion
Please I need help! -
But when the item is damaged you cant use it in a crafting recipe again? how do I fix this?
-
Recompiling didnt work either. im confused
-
Didnt work, do i have to recompile?
-
Do you mean mcmod.info? and placed inside the minecraft.jar in the jars folder?