Started by
Toibithieunang
on
Topic category: Help with Minecraft modding (Java Edition)
I'm trying to make a musket, but i want to make a reloading ammo system in it.
When you shoot, the musket switchs to "no ammo" . To reload the musket, you need to right click. When right clicked, the gun will have a cooldown ( and you can't shoot) by 1-6 secs.
But if you switch the gun slot, it will not load ammo. How can I make that?
Thanks.
instead of "right click", if I press R then is there possible?
Toibithieunang here's a image explaining how I would attempt such a thing https://imgur.com/a/oPmoIV0
Your tutorial is very good, but do you know how to check the gun slot?
("But if you switch the gun slot, it will not load ammo")
I'm not sure what you mean by "checking the gun slot"
Let me explain:
When you press R if gun has no ammo, it will start a cooldown for 1- 6 secs
In the reloading time (1-6secs) you need to keep the gun slot (Minecraft slot)
If you switch slot when It doesn't cooldown complete, It will not reload the gun ( and reset the cooldown)
hope you understand
Did you try my method tho? I'm 90% sure it should work
I can't find the "Get (..) for entity (..) block
I'm using mcreator 2022.2
That should be in the "custom variables" tab
Ok, but which trigger I need to put (When gun right clicked) in?
https://imgur.com/a/zzo8KWX
I found it
Thanks Screech - Obamium , you help me a lot!
But do you know how to check the gun slot?
@Toibithieunan What about checking if you hold the Musket in the Main Hand? This is much easier to do.
And don't use Global Variables for Items. Use instead of NBT Data to check. You could add for every Musket an boolean NBT that change if you need to reload or not. And for checking if you hold the Musket in the Main Hand you could use an Global Player persistent Variable.
I don't know to use something like NBT Data or Variables.
Can you help me?
How to use NBT Data on musket?