Started by
evanbenn2333333
on
Topic category: Help with Minecraft modding (Java Edition)
I want to know how to make a funcioning gun and i can have manual, semi atomatic, and automatic guns? i tried ranged weopen but i couldent figure it out?
All you have to do is make a ranged item. For manual, you can just keep it at default. At semi automatic (I'm guessing you can click and hold and it'll shoot like a machine gun), then you just tick the box that says shoot constantly when active. And for automatic, you just need a when item in mainhand tick procedure. Then you just make it shoot the bullet. And for a 3D model, you can make your own and export it as OBJ. You can do this on blockbench, or other apps if you know of any.
yeah ok but how do i make the magezines store ammo and use it?
You mean you want them to require bullets to use? Then just set the item for ammo to bullet or any item you made. For storing ammo inside the guns, it's a bit more complicated. Make a new variable (Type is number, Player lifetime) then basically when you equip your custom gun, each time it shoots it'll make the variable you made go down by 1. When that variable reaches 0, then it'll check if you have let's say 5 bullets in your inventory. If you don't, the gun won't shoot. If you do, it'll remove 5 bullets from your inventory, and set the variable back to 5. That way, you can store bullets in your gun. Or you could just do it the first way (much easier).