Minecraft Data Packs / Quality of Life

CC's Cycle Offhand Arrows

  • check_circle Advancements
  • check_circle Functions
  • 4,326 views, 1 today
  • 499 downloads, 0 today
  • 34
  • 31
  • 5
calebchan's Avatar calebchan
Level 52 : Grandmaster Meme
54

Cycle Offhand Arrows

Cycle through arrow types in the offhand slot by using your offhand key whilst holding a Bow or Crossbow!


Motivation



There's a bunch of interesting arrows you can shoot in the game. Arrows, Spectral Arrows, Firework Rockets, and a wide arsenal of Tipped Arrows. But how often in practice do you actually carry and use more than one type of arrow?

It's a hassle to pack many types of arrows. Usually you'd stow them all away in your inventory somewhere, keeping your hotbar for more important items. You simply shoot from your bow or crossbow, not knowing which arrow gets shot out.

In the end, nobody even bothers to use anything other than the regular Arrow, or perhaps even the Spectral Arrow since they're both farmable. And that's a shame, because there's so many interesting applications to all the Tipped Arrows!


Design


tl;dr, hold a (cross)bow in your mainhand and have arrows in your offhand, and press your (Swap) Offhand hotkey to cycle through arrows from your inventory, within the offhand slot.

The solution to this was to create a system to help players use different arrows easily. I wanted something that was elegant and user-friendly.


By selecting a Bow or Crossbow in the mainhand whilst a (Spectral/Tipped) Arrow or Firework Rocket is in the offhand, a player can trigger the system with the (Swap) Offhand hotkey. Usually this would swap the bow into the offhand and arrow into the mainhand.

Instead, the (Cross)Bow will stay in the mainhand whilst the arrow(s) in the offhand slot will get swapped with the next arrow slot in the inventory, and the next one, and so on.

It's quite simple.

The idea is that the projectile in the offhand slot will have top priority amd will always be used when you use a (cross)bow. This is a useful benefit, because you can see your currently selected arrow in your offhand slot from your HUD. All without opening the clunky inventory GUI.

Limitations



For a basic and simple system, there's really not much to ask for! It works flawlessly for what it is.

One small attribute is that the system simply cycles through any inventory slot with the right item (arrows + rockets). This means that it does not group stacks of the same item together, and will treat them as separate items: for example, 3 stacks of regular Arrows have to be cycled through three separate times. I left it at this because to group items, Tipped Arrows and Firework Rockets have complex NBT, and there's no easy way to group every case.

Additionally, when the the projectiles in the offhand slot are depleted (e.g. you use up your last Arrow), then your offhand will be empty; using the offhand key now will simply move your (cross)bow into the offhand. You'd have to manually put back whatever projectile into the offhand slot. I didn't want to make an auto-refill system.


TIP: What if you shot yourself with some tipped arrows? Strength? Speed? Slow Falling? Instant Health? You could pack the equivalent of a stack of potions in one inventory slot!
CompatibilityMinecraft 1.19
Tags

2 Update Logs

Update Showcase Video : by calebchan 09/14/2022 5:02:26 amSep 14th, 2022

Updated new showcase video, showing off features and interesting use cases!
LOAD MORE LOGS

Create an account or sign in to comment.

User4619383G
06/05/2023 8:28 pm
Level 1 : New Miner
User4619383G's Avatar
If you were able to implement this with the arrows being in a bundle we'd just straight up have quivers
2
xander_boss2
11/20/2022 5:02 pm
Level 1 : New Explorer
xander_boss2's Avatar
SHEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2
Kate1902019
09/15/2022 3:16 am
Level 37 : Artisan Princess
Kate1902019's Avatar
That would be useful!
Because stupid Mojang have the arrows that is first to be used!(BLAME MOJANG!!!!!!)
2
Lordphenex
09/09/2022 5:11 am
Level 40 : Master Miner
Lordphenex's Avatar
Good datapack with some clever techniques used in it !
I just want to let you know that your uninstall function is in your advancements folder.
2
calebchan
09/09/2022 5:47 am
Level 52 : Grandmaster Meme
history
calebchan's Avatar
Thank you for your praise! And thank you for letting me know — I've fixed it and will update it soon! Thanks for looking through it, and it's on GitHub so please feel free to collaborate! :D
2
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome