HELP WITH MOD WEAPONS PLEASE

Started by TheGremm on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
HELP WITH MOD WEAPONS PLEASE

So essentially, i want to make a revolver type item that fires different projectile based on what is loaded in the slots. Any ideas on how i could make it??? Any Help is greatly appreciated!

Joined Dec 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Maybe you could use a bunch…
Tue, 12/09/2025 - 06:10

Maybe you could use a bunch of if statements that check for a certain type of bullet in a certain slot before firing the gun and then fire the correct type of bullet. 

Joined Dec 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
  You could use if like…
Tue, 12/09/2025 - 06:49

 

You could use if like Beanerinsm said and use a variable to select exactly what type of bullet is going to be shot. I don’t know if you want it to be randomized, but you can use a number variable and do something like this:

 

RANDOMIZED:

If item in hand = revolver

  • if get number variable = 1
    • do shoot (name of projectile 1) from x y z with direction dx dy dz speed 1 inaccuracy 0
  • if get number variable = 2
    • do shoot (name of projectile 2) from x y z with direction dx dy dz speed 1 inaccuracy 0

Then you can either set a random number variable to select the bullet in a randomized way, or make a procedure that adds +1 to the variable every time it is called until it resets to 1 again, like:

       

  • set number variable to get random number between min 1 and max 10

    (you can put it on a different procedure and call it everytime the the gun shot using "call procedure 'randomizer'" for example)

     

OR

 

ORGANIZED AND FIXED WAY:

Set the default value of the variable to 1 and make a procedure like this:

  • if get number variable < 10
    • do set number variable to get number variable + 1
  • if get number variable >= 10 (10 is the max amount of bullets you want, change it to whatever number you want)
    • do set number variable to 1

(Name the procedure something simple like variable_loop.)

Then make the gun procedure call it every time it shoots something to change the bullet, like:

  • if get number variable = 1
    • do shoot (name of projectile 1) from x y z with direction dx dy dz speed 1 inaccuracy 0
    • call procedure variable_loop
  • if get number variable = 2
    • do shoot (name of projectile 2) from x y z with direction dx dy dz speed 1 inaccuracy 0
    • call procedure variable_loop
    •  

And keep doing this until you reach the number of bullets you want to put in the gun.