Open Jellychicken opened 2 years ago
I am very unfamiliar with animations. Do you have an example model with an animation that I can use for testing?
Sure. test-animation.zip
The idea looks very cool and could make the plugin more unique and not repeatable.
This is not possible with a plugin, the model will bob whenever we change the custom model data, which would ruin the animation It may be possible to prevent this if we made a companion datapack for weaponmechanics, but I don't know how that would work. Something worth investigating in the future, but impossible for now.
End of edit
Oh so it is literally just a bunch of different positions of the model? Did you use blockbench to make the animations or did you have to set the positions for each one?
Either way, here is my idea:
We could have a Transition
value that can define a list of custom model datas to animate.
Say we start in the Default
position. When the player scopes, we first check Scope.Transition
to see if we should be using an animation. If the animation is over, we can just set the skin to scope skin.
When going from Scope
back to Default
, we can use either Default
's transition, or Scope
's transition in reverse.
Transition:
Ticks_Per_Animation: 1 # Setting this higher may cause a "stuttery" animation
Use_Backwards_List_On_Leave: true # Setting this to 'true' causes the `Default` transition to never be used
List:
- 131 # frame 1
- 132 # frame 2
- 133 # frame 3
- 134 # frame 4
Currently skin config looks like this (I removed a scope_1 and no_ammo to make it less bulky)
Skin:
Default:
Type: <Material>
Legacy_Data: <Integer>
Custom_Model_Data: <Integer>
Durability: <Integer>
Transition:
Ticks_Per_Animation: 1
Use_Backwards_List_On_Leave: true
List:
- <Integer>
Scope:
Type: <Material>
Legacy_Data: <Integer>
Custom_Model_Data: <Integer>
Durability: <Integer>
Transition:
Ticks_Per_Animation: 1
Use_Backwards_List_On_Leave: true
List:
- <Integer>
Reload:
Type: <Material>
Legacy_Data: <Integer>
Custom_Model_Data: <Integer>
Durability: <Integer>
Transition:
Ticks_Per_Animation: 1
Use_Backwards_List_On_Leave: true
List:
- <Integer>
Sprint:
Type: <Material>
Legacy_Data: <Integer>
Custom_Model_Data: <Integer>
Durability: <Integer>
Transition:
Ticks_Per_Animation: 1
Use_Backwards_List_On_Leave: true
List:
- <Integer>
We will need some way to add fire actions (open/close animations) and per frame time
I know that he (https://streamable.com/ovm4cy / https://streamable.com/a5rhef) uses his private gun plugin for his animation work And he specified that "Use_Animation: <true/false> #if this value is true, when player swap item to wm gun, system will give player mining fatigue 200 for max seconds to delete minecraft own item swap motion". Minecraft own item swap motion == bobing item == swing up and down when changing item's itemmeta.
This is one Minecraft trick, and the model is not bob if mining fatigue 200 is given to player If player has mining fatigue 200, item is down the screen. And in resourcepack-side, add 9.6 to y value of model's display to pull item's model.
So, server can offer 3d model's animation to user
Thank you for your answer, bro.
This can be implemented as a plugin.
This video used Minecraft's tricks and ClientboundContainerSetSlotPacket
.
Quick FYI, you can use Item_Serializer
attribute GENERIC ATTACK SPEED
to achieve same thing as mining fatigue
EDIT
This is not possible with a plugin, the model will bob whenever we change the custom model data, which would ruin the animation It may be possible to prevent this if we made a companion datapack for weaponmechanics, but I don't know how that would work. Something worth investigating in the future, but impossible for now.
End of edit
Oh so it is literally just a bunch of different positions of the model? Did you use blockbench to make the animations or did you have to set the positions for each one?
Either way, here is my idea:
Concept
We could have a
Transition
value that can define a list of custom model datas to animate. Say we start in theDefault
position. When the player scopes, we first checkScope.Transition
to see if we should be using an animation. If the animation is over, we can just set the skin to scope skin. When going fromScope
back toDefault
, we can use eitherDefault
's transition, orScope
's transition in reverse.Transition: Ticks_Per_Animation: 1 # Setting this higher may cause a "stuttery" animation Use_Backwards_List_On_Leave: true # Setting this to 'true' causes the `Default` transition to never be used List: - 131 # frame 1 - 132 # frame 2 - 133 # frame 3 - 134 # frame 4
In current config
Currently skin config looks like this (I removed a scope_1 and no_ammo to make it less bulky)
Skin: Default: Type: <Material> Legacy_Data: <Integer> Custom_Model_Data: <Integer> Durability: <Integer> Transition: Ticks_Per_Animation: 1 Use_Backwards_List_On_Leave: true List: - <Integer> Scope: Type: <Material> Legacy_Data: <Integer> Custom_Model_Data: <Integer> Durability: <Integer> Transition: Ticks_Per_Animation: 1 Use_Backwards_List_On_Leave: true List: - <Integer> Reload: Type: <Material> Legacy_Data: <Integer> Custom_Model_Data: <Integer> Durability: <Integer> Transition: Ticks_Per_Animation: 1 Use_Backwards_List_On_Leave: true List: - <Integer> Sprint: Type: <Material> Legacy_Data: <Integer> Custom_Model_Data: <Integer> Durability: <Integer> Transition: Ticks_Per_Animation: 1 Use_Backwards_List_On_Leave: true List: - <Integer>
Missing
We will need some way to add fire actions (open/close animations) and per frame time
It is quite possible to implement this on WeaponMechanics: https://vimeo.com/706381367
I might revisit this soon #78 .
After some testing:
Is this still worth implementing?
Off hand animation is not a necessary feature, so it doesn't matter if you delete it.
Description
Adds the ability to use gun animation. This animation feature need resourcepack. If anyone use this feature, you should add 9.6 to translation y of 3d model's display.
example: https://streamable.com/ovm4cy https://streamable.com/a5rhef
Configuration