Started by
Teddy the artist
on
Topic category: Help with Minecraft modding (Java Edition)
so I've got a problem with an animated item, I'm trying to make a laser gun, but there's no "ranged animated item" and there's no option to make an animated item ranged, so I looked up a tutorial, it told me to do that if you right click, you shoot the laser.
So the thing worked, but I've got 2 problems now for some reason
- The movement the gun makes in first person is copied by any display of the same item. What I mean is, picture this, you have the gun several times in your hotbar, let's say slots 1 and 2 have the same gun on them, but also next to you, there's an itemframe with the gun displayed on it, when you right click to shoot, it shoots and ALL of them display the shooting animation, both guns in your hotbar move, the gun in the itemframe moves too, and if you're in third person, your arm doesn't move but the gun does.
- The gun shoots twice, idk what I did but the gun shoots two projectiles and deals 2 damage each time you shoot, even if you right click really quickly. The thing is that it has a cooldown, so if you hold right click it shoots every 10 ticks, but it shoots twice, deals 2 damage, and then applies the cooldown idk how to fix that
HELP PLEASE
the code I used (ik it's duplicated, if you don't see the difference, the one that's on top activates the shooting process but also deals 1 damage if you're not in creative mode, the one that's below it does the same thing but it tells the game not to damage the gun if you're in creative):