Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sword blocking animation #769

Open
lowercasebtw opened this issue Nov 1, 2024 · 9 comments
Open

Sword blocking animation #769

lowercasebtw opened this issue Nov 1, 2024 · 9 comments
Labels
enhancement A feature or enhancement suggestion for OldCombatMechanics

Comments

@lowercasebtw
Copy link

Now that 1.21.2 has come out and split the food component into two, food and consumable. The consumable component has a field named animation which allows you to specify the animation played when using said item, one of those animations being "block". Currently tho in 1.21.2/3, it only shows the blocking animation in third person but I reported the first person animation missing as a bug (https://bugs.mojang.com/browse/MC-275917) and it has been fixed and the first person animation has been introduced into 24w44a.

image

Yall should add a option/abandon using the shield as the way of blocking and instead give the swords the new consumable component with the animation of "block" and consume seconds of 3600 (same time as it was hardcoded in 1.8)

@lowercasebtw lowercasebtw added the enhancement A feature or enhancement suggestion for OldCombatMechanics label Nov 1, 2024
@lowercasebtw
Copy link
Author

Also cool side note, they fixed this bug: https://bugs.mojang.com/browse/MC-152728
This now fixes/reintroduced sprint resetting

@lowercasebtw

This comment was marked as spam.

@lowercasebtw

This comment was marked as spam.

@lowercasebtw

This comment was marked as spam.

@notwhitebear
Copy link

This is currently difficult to achieve, ProtocolLib still can't be loaded on 1.21.4 server. I made a plugin to implement this animation just now. (but it can't reduce damage)
plugin.zip
here is the plugin, it depends on Nbt API.

src:
src.zip
feel free to use it.

@kernitus
Copy link
Owner

Now that 1.21.2 has come out and split the food component into two, food and consumable. The consumable component has a field named animation which allows you to specify the animation played when using said item, one of those animations being "block". Currently tho in 1.21.2/3, it only shows the blocking animation in third person but I reported the first person animation missing as a bug (https://bugs.mojang.com/browse/MC-275917) and it has been fixed and the first person animation has been introduced into 24w44a.

image

Yall should add a option/abandon using the shield as the way of blocking and instead give the swords the new consumable component with the animation of "block" and consume seconds of 3600 (same time as it was hardcoded in 1.8)

That only seems to deal with the animation, but we use the shield because it genuinely does block damage, we just configure by how much. How could we ever tell if the damage was meant to be blocked or not otherwise?

@kernitus kernitus changed the title Consumable Block Animation Sword blocking animation Dec 24, 2024
@lowercasebtw
Copy link
Author

lowercasebtw commented Dec 26, 2024

By checking if the current use item has consumable of type block & has the custom data field of whatever to check if it is a OCM blocking tool/is a sword?

@lowercasebtw
Copy link
Author

lowercasebtw commented Dec 26, 2024

There is many ways to check if you are blocking as the consumable thing makes the sword act as a BLOCKING item like shield, so you should be able to do like "isBlocking" or whatever spigot/paper method is and do the custom reduced damage or whatever

@kernitus
Copy link
Owner

There is many ways to check if you are blocking as the consumable thing makes the sword act as a BLOCKING item like shield, so you should be able to do like "isBlocking" or whatever spigot/paper method is and do the custom reduced damage or whatever

That's assuming the client sends packets with the blocking bit set. Also does this mean we have to modify all sword to have the animation property? Because OCM does not modify any items and this is deliberate, because it leads to a nightmare of tracking what items were changed when, and what happens if you uninstall the plugin. It's the same reason we don't edit the attack damage labels on the items directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or enhancement suggestion for OldCombatMechanics
Projects
None yet
Development

No branches or pull requests

3 participants