gnembon / scarpet

Public Repository of scarpet programs for Minecraft
Creative Commons Zero v1.0 Universal
359 stars 162 forks source link

Add arrow restocking #357

Open rv3r opened 1 year ago

rv3r commented 1 year ago

Fixes #255 by saving arrow slot on bow or crossbow use and checking for slot change when bow or crossbow is released. Also updated comments to reflect this change and cleaned up spacing from #353.

Apparently I use global variables to solve my problems...

This can restock a bow and arrows in a single use (just don't try to get a bow from a keep box). It also easily restocks tipped arrows correctly because they use the same NBT tag for potion effect as regular potions. I tip my hat to whoever did that.

rv3r commented 1 year ago

Marked as draft since there are some errors I just found. Will fix next week tomorrow.

rv3r commented 1 year ago

Also, are we okay with this script not restocking fireworks for crossbows? I can do that, but while it isn't exactly what the issue mentioned, it's a similar idea.