Blocking Mechanic

Idiotischer

New member
May 4, 2025
5
0
1
Is the new 1.21.5 blocking feature already implemented? I cant find it in the itemmeta, I'd need the percentag of how much damage it blocks, what it blocks, etc yk? (also sry for posting this 2 times, but i didnt figure out how to delete the posts in this forum and i posted it in the wrong category haha)
 

Idiotischer

New member
May 4, 2025
5
0
1
Oh yeah, exactly! But i still didnt find the method to get the BlocksAttacks from the Item (for example a sword itermstack) i searched for the BlocksAttacks in Intellij, yet i didnt find anything, is trhere a getter or smth? I onyl foudn smth in NMS though i only use NMS for Mixins and want my code to be as mcuh version compatible as possible/ i dont knwo hwo to apply the BlocksAttack to an item too, i newer used that much of the paper api except for palyer profiles etc. i mean i propably need to use datacomponents like nms does it but in a paper way...

Edit, i just googledf the datacomponent api and found hwat i searched for, now i have an idea of what to do (item.setData(DataComponentTypes.BLOCKS_ATTACKS, ...)); For others you can use this: https://docs.papermc.io/paper/dev/data-component-api/
 
Last edited:

Idiotischer

New member
May 4, 2025
5
0
1
is there any way to set the damage reduction percentage now? i didnt find anything like that still haha
 

Idiotischer

New member
May 4, 2025
5
0
1
public static record DamageReduction(float horizontalBlockingAngle, Optional<HolderSet<DamageType>> type, float base, float factor) nsm does have this lol
 

mbaxter

Cat Wrangler
Staff member
Dec 14, 2021
125
25
21
18
over there
I know very little about this API, having never used it myself. Our forums are much lower traffic than our Discord, where you may find prompter replies.
 

Idiotischer

New member
May 4, 2025
5
0
1
I know very little about this API, having never used it myself. Our forums are much lower traffic than our Discord, where you may find prompter replies.
sry, i deleted the message to late/sent it before checking my mails, i created an issue post last week and they already have an open PR so this gets added hopefully, anyways thank you for the help, hopefully i will not have to deal with this anymore than