#Hi I need help modifying a datapack

1 messages · Page 1 of 1 (latest)

loud yoke
#

This datapack brings back sword blocking in 1.21.5 and makes the block mitigate all damage like shields do. How could I modify this (code? Command? Function?) to do the same thing, but for axes?

loud yoke
#

Also this is less important but if anyone knows a better block sound than the shield one that would be great

hasty tendon
#

Have you considered changing the reference to the swords tag to an axes tag?

loud yoke
#

It didn't work

hasty tendon
#

What exactly did you try?

loud yoke
#

I also tried "swords" to "axes"

hasty tendon
#

Show your work

loud yoke
#

And then I tried changing "swords" to "axes" and then also changing "weapons" to "tools"

loud yoke
#

Im not at my laptop

hasty tendon
#

Well

loud yoke
#

I can in a few minutes

hasty tendon
#

Can't really help if I can't see what you're doing

loud yoke
#

That's about all I tried though

#

Is it okay if I get back to you in about 20-30 minutes?

#

I was hoping that Image would be enough

loud yoke
#

Can you still help me?

minor gazelleBOT
#

-# (helpers summoned) <@&1166082198152159386> <@&1202694677766348840>

hasty tendon
#

I'm still waiting on info from you

loud yoke
#

Heres what I have so far

loud yoke
#

But I figured since axes take double damage from being used as weapons Minecraft probably doesn't label them as such

hasty tendon
#

It's not about what kind of item it is, it's about the slot you're checking for it in

#

The item you're holding in your main hand is in the weapon.mainhand slot

#

There is no tool.mainhand slot

loud yoke
#

Oh ok

#

So

#

What's wrong with it

hasty tendon
#

... I just told you

loud yoke
#

Well yes but I already tried using it as just weapon.mainhand

hasty tendon
#

Show your work

loud yoke
#

And just replacing swords with axes

hasty tendon
#

I can take your word for it all I want, and I do, but I need to see what you actually physically entered to confirm it's correct or identify other issues

#

I cannot read your mind

loud yoke
hasty tendon
#

Looks fine at a glance. Does the function validate?

loud yoke
#

What does that mean

hasty tendon
#

Does Minecraft recognize it as a function? Can you run it in chat?

loud yoke
#

I'll try

#

Function runs but

#

I still can't block with the axe

hasty tendon
#

Try just running the command yourself directly in chat, but just everything before the run

loud yoke
#

Uh

#

So what do I type

hasty tendon
#

The command that's in the function, starting with execute and all the way until it says, but excluding, run

loud yoke
#

When I type /execute

#

Run is the next command

#

There is no command between execute and run

hasty tendon
#

You don't need to type anything, you just need to copy and paste from the function you already have

#

What you're seeing is the in-game autofill

loud yoke
#

Copy and pasted it correctly like you said

#

Didn't include run

hasty tendon
#

Great

loud yoke
#

It said test passed, count 1

hasty tendon
#

Yes I see that

loud yoke
#

When I did it correctly

hasty tendon
#

Yes, thank you, got it, understood

#

So, it seems like the component is being applied to the axe correctly, which suggests that it may just not work on axes because they already technically have right click behavior

#

Essentially the command works fine, and axes just can't be made to block

loud yoke
#

Oh

#

Is there any way to remove axes stripping

#

To allow for the right click to be freed up

hasty tendon
#

Not really, unfortunately that isn't a component yet that can just be removed. The alternative would be to replace the axe with a totally different item that uses an axe item model and all the other components of vanilla axes, plus the blocks_damage component, but doesn't have any right click behavior

#

Which is certainly doable but not something we can easily walk you through with the level of experience you have

#

If you're looking to get into data packs more fully, I recommend starting with our guide

viral jewelBOT
loud yoke
#

Uh

#

Thanks

#

Sorry for wasting your time

hasty tendon
#

Not a waste of time, I'm here to help

minor gazelleBOT