Metadata and damage are the same thing. You cannot use any metadata other than 0 on an item that has a maxUses attribute attached to it. This is not a bug, it is simply how the minecraft engine handes metadata. All vanilla blocks that use metadata use it the same way.
Also, as far as our ender sword goes, a lot of those attributes need a metadata value to work properly, even if they do not throw an error for not having one. And don't use damage[]; use one of the lines from my earlier post about damage. I believe it's about halfway down 318 or 319. If all else fails, I'll be posting updated examples on the wiki when I get home. (Sorry for any misspellings, it's 2:30 am local time, I'm at work, and this is an iPod touch.)
So, onHitEntity = damage.Living works, but the durability is infinite. When I re-add the attribute damage.itemstack(1) on a new line, it has durability but completely ignores the damage property and this is annoying.
So, onHitEntity = damage.Living works, but the durability is infinite. When I re-add the attribute damage.itemstack(1) on a new line, it has durability but completely ignores the damage property and this is annoying.
Try this. This also adds in blocking on right click, which you can hold for an hour before it stops blocking. I think everything else is set the same as you had it, might want to look over it quick in case i missed something.
Also, I absolutely despise using vanilla textures for custom items, so, I'll just leave this here.
Try this. This also adds in blocking on right click, which you can hold for an hour before it stops blocking. I think everything else is set the same as you had it, might want to look over it quick in case i missed something.
Also, I absolutely despise using vanilla textures for custom items, so, I'll just leave this here.
Does using onHitEntity twice actually work now? I am pretty sure the correct way to use the trigger was to use all the functions in one line like so:
Also, if you are in creative mode, the itemstack.damageItem(1) function does nothing. I like this feature, but it might be confusing when testing in creative so make sure your not in creative mode, luigimario22.
Also, if you are in creative mode, the itemstack.damageItem(1) function does nothing. I like this feature, but it might be confusing when testing in creative so make sure your not in creative mode, luigimario22.
I couldn't figure out the syntax for multiple arguments, but the way I have mine worked just fine last time I used it. I have a whole set of weapons using things I've added in, and they all take and do damage just fine
I will be using this information to simplify though.
Try this. This also adds in blocking on right click, which you can hold for an hour before it stops blocking. I think everything else is set the same as you had it, might want to look over it quick in case i missed something.
Also, I absolutely despise using vanilla textures for custom items, so, I'll just leave this here.
The Diamond Sword texture was a placeholder. I have my own now.
Also, if you are in creative mode, the itemstack.damageItem(1) function does nothing. I like this feature, but it might be confusing when testing in creative so make sure your not in creative mode, luigimario22.
I test it in survival and it doesn't work regardless, but I'll test out Slain's piece of code and let you know of any further issues.
The Meaning of Life, the Universe, and Everything.
Join Date:
1/15/2011
Posts:
100
Minecraft:
Pants_WP
Member Details
So, I implemented Slain's code. Almost everything is working, except one thing; the durability bar. It has some improvement as now the bar actually shows and so does the durability. But, now it's just constantly stuck at 1499/1500 by looking at the F3 debug mode (Ctrl+F3+H) and yes, I'm testing this on survival. So, what has gone wrong?
So, I implemented Slain's code. Almost everything is working, except one thing; the durability bar. It has some improvement as now the bar actually shows and so does the durability. But, now it's just constantly stuck at 1499/1500 by looking at the F3 debug mode (Ctrl+F3+H) and yes, I'm testing this on survival. So, what has gone wrong?
I just realized that you didn't set maxStack for your sword. As of 0.10.6, the default stack size is 64 so you will likely need to add "maxStack=1;" to your sword.
Does anyone know what block types the thickness[] attribute has an effect on? I've tested it on posts and it works just dandy
Also, does anyone know how to texture posts... It doesn't seem to want to load the textures I've defined using textureFileXP etc.
The thickness attribute only affects "post" and "crossTexturePost" block types. I haven't tested either post type, but the documentation seems to indicate that you have to use textureFileFront, textureFileSides, and textureFileBack for post type blocks.
The thickness attribute only affects "post" and "crossTexturePost" block types. I haven't tested either post type, but the documentation seems to indicate that you have to use textureFileFront, textureFileSides, and textureFileBack for post type blocks.
Yes, I read that too, this poses an issue for me, as I was hoping to be able to set a different texture for the top. After actually setting a texture and using the post, I can kind of see why, since the top of the post can be used as the side (posts can be placed horizontally)
Yes, I read that too, this poses an issue for me, as I was hoping to be able to set a different texture for the top. After actually setting a texture and using the post, I can kind of see why, since the top of the post can be used as the side (posts can be placed horizontally)
According to one of CubeX2's posts back in March (found here), you can set the top texture of furnaces by setting textureFileYP. The same might be true for posts. I don't know what would happen to the top texture when you place it horizontally though. You might also check to see if textureFileFront and textuerFileBack actually refer to the ends of the post or actual front and back (side facing you and side facing away from you).
According to one of CubeX2's posts back in March (found here), you can set the top texture of furnaces by setting textureFileYP. The same might be true for posts. I don't know what would happen to the top texture when you place it horizontally though. You might also check to see if textureFileFront and textuerFileBack actually refer to the ends of the post or actual front and back (side facing you and side facing away from you).
I tried setting yp for posts before i left and it actually only worked when the post was horizontal. And, interesting... So in theory if I set what I want to be the top as front and look straight down while placing them it should work in my favor, non?
I need assistance again...
I'm trying to damage an item in a crafting recipe. Simple stuff.
Unfortunately adding the "-" to the end doesn't seem to do much, except crash the game.
---- Minecraft Crash Report ----
// Don't do that.
Time: 9/10/13 4:34 PM
Description: Initializing game
org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (mod.js#121)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1754)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1473)
at script(mod.js:121)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at org.mozilla.javascript.Context.evaluateReader(Context.java:1110)
at cubex2.cs2.DefaultMod.init(DefaultMod.java:132)
at cubex2.cs2.ModLoader.initMods(ModLoader.java:41)
at cubex2.cs2.CustomStuff2.postInit(CustomStuff2.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:701)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:231)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:506)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)
at net.minecraft.client.main.Main.main(SourceFile:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
Caused by: java.lang.NullPointerException
at cubex2.cs2.util.GeneralHelper.getItemStack(GeneralHelper.java:66)
at cubex2.cs2.util.GeneralHelper.getItemStack(GeneralHelper.java:29)
at cubex2.cs2.scripting.ScriptableMod.addRecipe_do(ScriptableMod.java:344)
at cubex2.cs2.scripting.ScriptableMod.addShapelessRecipe(ScriptableMod.java:300)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
... 47 more
Rollback Post to RevisionRollBack
This is a signature. You read it, then you go about your business.
I need assistance again...
I'm trying to damage an item in a crafting recipe. Simple stuff.
Unfortunately adding the "-" to the end doesn't seem to do much, except crash the game.
Hi, if you can, can you please add config to More Furnaces to disable each furnace? I would like to enable only Iron, Netherack and maybe Obsidian on server atm, I find other ones too OP (just personal opinion, thus config
Did you at least install Custom Stuff 2 correctly and test before making a mod? If it runs before adding custom blocks or items, then please post what you have actually done as I have not seen that error before.
So, onHitEntity = damage.Living works, but the durability is infinite. When I re-add the attribute damage.itemstack(1) on a new line, it has durability but completely ignores the damage property and this is annoying.
Also, I absolutely despise using vanilla textures for custom items, so, I'll just leave this here.
Does using onHitEntity twice actually work now? I am pretty sure the correct way to use the trigger was to use all the functions in one line like so:
Also, if you are in creative mode, the itemstack.damageItem(1) function does nothing. I like this feature, but it might be confusing when testing in creative so make sure your not in creative mode, luigimario22.
I couldn't figure out the syntax for multiple arguments, but the way I have mine worked just fine last time I used it. I have a whole set of weapons using things I've added in, and they all take and do damage just fine
I will be using this information to simplify though.
The Diamond Sword texture was a placeholder. I have my own now.
I test it in survival and it doesn't work regardless, but I'll test out Slain's piece of code and let you know of any further issues.
Also, does anyone know how to texture posts... It doesn't seem to want to load the textures I've defined using textureFileXP etc.
I just realized that you didn't set maxStack for your sword. As of 0.10.6, the default stack size is 64 so you will likely need to add "maxStack=1;" to your sword.
The thickness attribute only affects "post" and "crossTexturePost" block types. I haven't tested either post type, but the documentation seems to indicate that you have to use textureFileFront, textureFileSides, and textureFileBack for post type blocks.
Yes, I read that too, this poses an issue for me, as I was hoping to be able to set a different texture for the top. After actually setting a texture and using the post, I can kind of see why, since the top of the post can be used as the side (posts can be placed horizontally)
According to one of CubeX2's posts back in March (found here), you can set the top texture of furnaces by setting textureFileYP. The same might be true for posts. I don't know what would happen to the top texture when you place it horizontally though. You might also check to see if textureFileFront and textuerFileBack actually refer to the ends of the post or actual front and back (side facing you and side facing away from you).
I tried setting yp for posts before i left and it actually only worked when the post was horizontal. And, interesting... So in theory if I set what I want to be the top as front and look straight down while placing them it should work in my favor, non?
This bug has been reported about a jillion times over the past three pages
I'm trying to damage an item in a crafting recipe. Simple stuff.
Unfortunately adding the "-" to the end doesn't seem to do much, except crash the game.
---- Minecraft Crash Report ----
// Don't do that.
Time: 9/10/13 4:34 PM
Description: Initializing game
org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (mod.js#121)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1754)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1473)
at script(mod.js:121)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120)
at org.mozilla.javascript.Context.evaluateReader(Context.java:1110)
at cubex2.cs2.DefaultMod.init(DefaultMod.java:132)
at cubex2.cs2.ModLoader.initMods(ModLoader.java:41)
at cubex2.cs2.CustomStuff2.postInit(CustomStuff2.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:701)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:231)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:506)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)
at net.minecraft.client.main.Main.main(SourceFile:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
Caused by: java.lang.NullPointerException
at cubex2.cs2.util.GeneralHelper.getItemStack(GeneralHelper.java:66)
at cubex2.cs2.util.GeneralHelper.getItemStack(GeneralHelper.java:29)
at cubex2.cs2.scripting.ScriptableMod.addRecipe_do(ScriptableMod.java:344)
at cubex2.cs2.scripting.ScriptableMod.addShapelessRecipe(ScriptableMod.java:300)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
... 47 more
This game is so oreing.
EDIT: ahah, why is my ipad so hard to type on >.>
http://pastebin.com/cpjiDMZX
GENERATION 9001: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment
Did you at least install Custom Stuff 2 correctly and test before making a mod? If it runs before adding custom blocks or items, then please post what you have actually done as I have not seen that error before.