Custom arrows? (HELP PLEASE)

Started by theregginator on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Custom arrows? (HELP PLEASE)

I've seen a few posts about this before, but basically all of them ended up unresolved and are VERY outdated. I wanted to know how I could make custom arrows, and after not finding ANYTHING helpful, I now come here. Also, I know that it technically IS possible to do so as multiple mods before have done this in MCreator; I just don't know HOW. I have projectile entities set up and connected to arrow items (using newest 2024.3 snapshot), I just don't know how to get them to be shot from a bow or crossbow. Any help is appreciated, and thank you in advance!

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hmm, this one is not…
Tue, 10/01/2024 - 00:58

hmm, this one is not completly obvious, in base java minecraft the only things that can fire from a bow are arrows and potion arrows, however you can replicate this via global procedures, when a player uses right clicks with an item you can check if that item in mainhand is bow or crossbow. you can trigger the animation by swapping said item in your offhand or the target item for an arrow. this counts as using an item. when doing this use another global procedure that detects when a player is using an item (and make an if statement for if its a bow or crossbow) and your desired projectile item is offhand, when letting go of a bow or firing it, it counts as finish using an item, another global procedure to check wether or not your projectile item is in your offhand and your holding a bow, you can despawn the arrow as it counts as a immdient source entity, then shoot your projectile with whatever code you want. crossbow, when finished charging it counts as finishing using the item, you can swap the crossbow for a custom one that shows your projectile in it, then simpily when used it will give back your crossbow with minused durability