Hiiyaa! This question is for a datapack I'm working on called Arcana (not my main project It Spreads), where I want to use the new item components to create wands with spell slots you can swap out and switch between. I have a few ideas for how to do this, but I'm interested to see what other people can come up with. Basically, I want to store spells in the custom data of a Wand item, and use the consumable component to give the spells custom cooldowns, casting times, and animations. The biggest problems currently are getting the item back after consuming it, updating the spell when it is swapped, adding and removing spells from the wand, and displaying the selected spell (which changes while shift-clicking). It also needs to work in mainhand and offhand.
#ADVANCED: Swappable spells 🪄 (Arcana)
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
Don't forget to close or resolve your old questions once you're done with them. It makes our lives much easier! :D
Open question: #1305888154573607013
I'm not really sure where to start here, is the issue that you don't know how to do any of this? Cause it sounds like you know exactly what to do
That's certainly what I would do, so I don't think you're gonna get a whole lot of alternative methods. Only thing I might do differently is not have the wand actually get consumed so you don't need to worry about giving it back
I know how to use most things that I'll need in order to accomplish this, I'm just really not sure how to do these things specifically
Wait, how would I do that?
The normal consumable-right-click-detection method
I'm using the consumable component as-intended, since the process has to finish in order to make everything else work
Unfortunately it requires you use a scoreboard timer as the method of cooldown, but imo that's a small tradeoff for a much easier system
Which things? It seemed like you listed every thing
I'm not really sure how to get the item back easily
Then I think you're gonna end up with more complications, primarily with as you identified, giving back the same item that was consumed
Yeah, I'm frankly not super sure either. The fact it's such a dynamic item makes that tough
Is it possible to make the consume_remainder be the original item?
You'd probably need to store the item's data to storage before consumption, but that runs into trickiness when a player has more than one wand
I don't think so, again because it is so dynamic
You can make it give back a wand with pre-loaded spells, and make an option for every combination of spells, detecting which ones the old wand had to determine which to give
But obviously that would suck
I don't quite understand the question
Oh wait I guess you might be able to store the current item into its own use_remainder component?
That sounds really janky, I'm not actually certain it's possible or would work
Hmmmmmm
Would I be able to save it to storage, and detect a specific use_remainder item in mainhand/offhand and replace it with the stored item somehow??
Presumably
I'm not super experienced with using data storage, but that sounds feasible. Certainly detecting the dummy use remainder item is, as is replacing it with something
So it just comes down to how easy it is to have that replacement incorporate data from storage
Could I possibly copy it to an armor stand and run a data store command thingy to store the item into itself and then give it back?
Sure
It would be hella janky lol
I think neither way is straightforward at all 😭😭
Like, I'm planning to use advancements to detect the usage
Welcome to data packs 😅
For sure
lmaoo
hmmm
I've decided I'm gonna have a spellcast function when the wand is used that will copy it over
Basically, I'll just detect when the wand is eaten and give it to an armor stand/item display/item and stuff it back into itself
...
we use the weirdest freaking coding language ever don't we 😭
<@&1166082198152159386> <@&1202694677766348840>
Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)
I use a different system than you and this is still 1.19(?) (I forgot) but you can maybe get some ideas out of it.
Oooooo!
Ty! I'll check this out
Thanks! That's fairly straightforward, tyy
I think I'll try to do something similar, but make modified versions for swapping vs using
So ummmm
How should I switch like
The selected slot
actually I have an idea for that nvm
Anyways, I'm wondering how to swap out the spells
Anyone have any ideas? :3
Probably an item modifier
I would use an item modifer.
How would one use an item modifier for that?
What do you know about item modifiers currently?
Well, I was planning to use them to change the consumable component and the lore and stuff for each spell
So what then isn't clear about how you'd use it to change the custom data component?
I'm... not really sure how to switch the spells in the different spell slots on it
You can't, really. You have to overwrite the entire custom data component. So, you'd need some way to both determine which slot is being replaced, and retain what the other slot is
There is the option of using custom enchantments that don't have any behavior of their own to represent the spells, and I could see a few routes to go there
Elaborate 🤔
Like
Like how should I make the player able to change out the spells? Some kind of custom crafting table? A GUI? Is it possible to basically take each custom data spell slot and turn it into some kind of spellbook or scroll that stores the spell, and then be able to rearrange or add new ones and turn them back into data?
Anyways, I will try to implement some of these things ^^
Really more of a creative question
I suppose!!
Alright, I'll try to figure this out and then come back if I need help :3