Open JakeGBLP opened 9 months ago
Sovde also mentioned that this can be solved with a function, and provided the following snippet:
on right click:
# check main hand
if tool of player is a diamond axe:
throwAxe(player, (player's tool), 0.4)
set player's tool to air
# check off hand
if offhand tool of player is a diamond axe:
throwAxe(player, (player's offhand tool), -0.4)
set player's offhand tool to air
function throwAxe(thrower: entity, item: item, offset: number = 0):
set {_v} to vector in {_thrower}'s direction
spawn item display {_offset} to the right of {_thrower}'s eyes:
set display item of entity to {_item}
set {_e} to entity
loop 100 times:
teleport {_e} to location of {_e} ~ {_v}
wait tick
kill {_e}
give {_item} to {_thrower}
which does solve the issue, but in my opinion just doesn't feel natural
In my opinion, this isn't entirely necessary, as it's easy enough to deal with this manually. However, I think taking a closer look at how exactly we want EvtClick to function is a good idea. The current solution is a leaky bandaid, if you'll forgive my mixture of metaphors.
Looking at it with fresh eyes and the knowledge of modern minecraft mechanics and re-evaluating how much control we want to give users is a good idea, in my opinion.
Suggestion
Skript tracks the click events to avoid calling a click event with both hands at the same time, i think there should be a way to listen to both at the same time without the use of a function or a loop (looping both held items)
@sovdeeth mentioned that something like:
is ambiguous, which I agree with, and opted for something like
adding both wouldn't hurt in my opinion but if one must be chosen the the latter is the way to go about it
Why?
to explain it better, here's a dumbed down version of what I'm doing, with and without the change I'm suggesting
to make the same thing it becomes necessary to add 2 loops
and this doesn't even take into account the fact that, in the
WITHOUT
example, since we're creating a sort of projectile axe, how would you even handle killing the display item and giving back the item? because those 2 entities need to have separate collision checks to make that happen, so that would be another problem that would be easily avoided if support for both hands was addedOther
worth mentioning that this might required #6207 to be completed, not sure about this
Agreement