#Help on implementing dual wielding
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: #1331320664417636484
im working on 1.21-snapshots btw (havent decided yet)
<@&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)
Why not just make the item have attribute modifiers that can apply in either hand?
I think they're talking about all items in general
So, you'll probably want to use an attribute modifier that gets removed and re-applied whenever the player changes their inventory
Using an advancement with the "inventory_changed criteria", you can detect when the player moves items around, preventing the updating from applying constantly
Then, you can get the item modifiers of the item in offhand, copy that value into a scoreboard (scaled up), run whatever algorithm you need, copy that score into storage, then run a macro function with that storage to re-apply the attribute modifier with the new value
thank you, that really shows a clear road to take
though im not sure how i can get the item modifiers and i don't reallt understand the consept of macro functions
i would be grateful if someone could shine light on those topics
https://misode.github.io/
Herr you create item modifier with a YouTube turorial (there are plenty, take a pick)
And macros basically work that way:
“say something”
“$say $(something)”
so if you store variable “something” into storage, you can access it in a function later.
function example:test with storage example:test test
So, if we have storage example:test test like that: {“something”:”Hello!”,”number”:12}
We will get next result:
$say $(something)
$scoreboard players add test test $(number)
[server] Hello!
added 12 to score of test test
The one big part I'm not too sure about is how to get the item modifier from the offhand item
Inventory.-106 | weapon.offhand | something else if you mean that?
I'm not certain lol
I just know there are item modifier lists you need to parse through
This question has been inactive for some time, so it's going to be closed for inactivity. If you still need it, please disregard this message.