Sorry, I meant "ItemPotion" XD You need an output is what I was trying to explain. From what I saw, the event takes an ItemStack array which, from what I am guessing [0] is the first of three slots in the top [1] is the second and so on. Try to make all of those take something like a carrot and set [4] to a potion. Kind of a rough guess on what it is used for.
Do *not* use a world/entity/whatever tick event! Use the onUpdate override in your item class, this will still run every tick but only if the item is in the inventory of a player. This is in 1.7.x but i dunno about 1.6.x parameters so check your Item.class.
EDIT: What i'd do is have it check the isHeld bool, if it's false then just do nothing, but if it's true then compare that to a class field (that is false by default) and if it's different then that means it has just changed to the "held" state, so yeah... the rest is self explainatory (reverse that logic to "reset" for next sound play when they swap the weapon out). Something like that would work well.
Ok that's a smart approach but, I need it to be like when any sword is held the sound is played once. Got any ideas?
I haven't tried this but, look through the event for items, color settings and such. If you can't find that take a look at the potion classes and simply add a potion like they do. I believe you could do something like this:
Change the packages "tutorial.generic" and "tutorial.generic.client" to "com.example.examplemod.tutorial.generic" and "com.example.examplemod.tutorial.generic.client" When you make a package such as "com.example.examplemod" you need to have other packages extending off that such as "com.example.examplemod.tutorial.generic" or, it will be put into src.minecraft and your mod will not be compatible with other mods. Right click the package and hover over refactor than click rename and change them to the names I specified.
Also, you're in the right source folder so don't worry!
So, what I want is kinda what the Portal Gun mod has achieved. When you hold an item in your hotbar, a sound is played JUST ONCE until you select another item and go back to the previous. My question is how may I accomplish this? I have tried using bothe Server and Client tick handlers with no success. Any help is appreciated.
So, I got all of my NEI guis to work and, when I was trying to recompile it; it kept saying that it can't find the NEI files such as the extension of the NEIConfig and such. Honestly, I thought this was going to happen and I would really love a way to fix this.
Honestly, Mojang has no care into making Minecraft a unique game anymore. They basically wait for modders to make something that is amazing than, decompile it and add it without giving any credit to the author. At least when someone made the piston mod Mojang gave credit to him but, then again, the piston mod was very popular so you kind of had to give credit. Although, complaining about the time it takes to release updates is a form of ignorance towards how long it actually takes through trial and error to make something work. Myself as a coder spends a lot of time trying to make things work in the correct fashion and, making it look pretty. But, I say again; Mojang just doesn't care anymore.
0
0
This is a very simple error. find a tutorial on how to setup and Client and Server proxy and you should be fine.
1
0
0
0
0
Ok that's a smart approach but, I need it to be like when any sword is held the sound is played once. Got any ideas?
0
This would go in your load method I believe.
0
Also, you're in the right source folder so don't worry!
0
- Joey
0
0
Thanks!
- Joey
5
0
0
Damn right.