If you've played Minecraft before 1.9, there is a great chance that you know when you right-click with a sword, it (folds? Idk what verb to put here)
I wanted to make it so that axes and shovels also do the same thing
I've already made a lot of animation of how it will be folded, but I'm not sure can right/left clicking affect how it looks
I've used other mods before and some mods allow the user to see their bow's left-click animation while holding right-click, but I'm not sure how to do that as well.
The only items that have right-clicked detection are carrot on a stick and warped mushroom on a stick.
You can change the item's data based on the right-click using command blocks, but you can't add shovel/pickaxe/axe/hoe functionality to them. You can only make it look like a 1.8 Sword.
The only items that have right-clicked detection are carrot on a stick and warped mushroom on a stick.
You can change the item's data based on the right-click using command blocks, but you can't add shovel/pickaxe/axe/hoe functionality to them. You can only make it look like a 1.8 Sword.
Wrong; with real mods (not commands/datapacks or "pseudo mods") you can do literally anything. Here is the code from 1.6.4 that makes swords perform the blocking animation (the correct term for it), which will also apply to any item whose "getItemUseAction" method returns "EnumAction.block". If this code does not exist in newer versions you can add it yourself (using whatever alternative to GL11 they may be using as the game, at least as of 1.17, no longer use any fixed-function OpenGL):
However, you are correct that a client-side only mod can only change the appearance, not add actual blocking functionality as damage is handled server-side, but a server-sided mod can easily be made to do that as well (IDK what the code in newer versions looks like but as shown here you'd look for something referencing "EnumAction.block" or "getItemUseAction", or whatever their may now be called; the method shown above is in ItemRenderer and the following method is in the EntityPlayer class):
You can even replicate the old damage reduction with this code (also in EntityPlayer), which reduces damage by up to 50%* instead of simply negating it and are non-directional with no delay (this could be used in addition to shields by checking for the item being held and applying the proper calculations):
*It is worth noting that the original vanilla code had a bug; if damage was less than 1 you'd actually take MORE damage (e.g. damage = 0.5; (0.5 + 1) * 0.5 = 0.75), thus I added the check for damage > 1.
But this is the resource packs section, not the modding section.
The OP mentions mods and even includes [mod] in the title so I assume they actually meant to put it in the modding section (which is actually part of the same larger category, "mapping and modding"), unless the "mods" they used were actually resource packs (or more likely, data packs, which are considered to be mods and not resource packs).
The OP mentions mods and even includes [mod] in the title so I assume they actually meant to put it in the modding section (which is actually part of the same larger category, "mapping and modding"), unless the "mods" they used were actually resource packs (or more likely, data packs, which are considered to be mods and not resource packs).
I was thinking of using a texture pack to do that because making mods is a little bit complicated
Now I know that it is not possible with texture packs so I'll be working on mods from now on!
Thank you anyways!
If you've played Minecraft before 1.9, there is a great chance that you know when you right-click with a sword, it (folds? Idk what verb to put here)
I wanted to make it so that axes and shovels also do the same thing
I've already made a lot of animation of how it will be folded, but I'm not sure can right/left clicking affect how it looks
I've used other mods before and some mods allow the user to see their bow's left-click animation while holding right-click, but I'm not sure how to do that as well.
You can't.
The only items that have right-clicked detection are carrot on a stick and warped mushroom on a stick.
You can change the item's data based on the right-click using command blocks, but you can't add shovel/pickaxe/axe/hoe functionality to them. You can only make it look like a 1.8 Sword.
Meow~
#F5F8FB
KittenKatja ♥
Wrong; with real mods (not commands/datapacks or "pseudo mods") you can do literally anything. Here is the code from 1.6.4 that makes swords perform the blocking animation (the correct term for it), which will also apply to any item whose "getItemUseAction" method returns "EnumAction.block". If this code does not exist in newer versions you can add it yourself (using whatever alternative to GL11 they may be using as the game, at least as of 1.17, no longer use any fixed-function OpenGL):
However, you are correct that a client-side only mod can only change the appearance, not add actual blocking functionality as damage is handled server-side, but a server-sided mod can easily be made to do that as well (IDK what the code in newer versions looks like but as shown here you'd look for something referencing "EnumAction.block" or "getItemUseAction", or whatever their may now be called; the method shown above is in ItemRenderer and the following method is in the EntityPlayer class):
You can even replicate the old damage reduction with this code (also in EntityPlayer), which reduces damage by up to 50%* instead of simply negating it and are non-directional with no delay (this could be used in addition to shields by checking for the item being held and applying the proper calculations):
*It is worth noting that the original vanilla code had a bug; if damage was less than 1 you'd actually take MORE damage (e.g. damage = 0.5; (0.5 + 1) * 0.5 = 0.75), thus I added the check for damage > 1.
TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.
TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.
Why do I still play in 1.6.4?
But this is the resource packs section, not the modding section.
Meow~
#F5F8FB
KittenKatja ♥
The OP mentions mods and even includes [mod] in the title so I assume they actually meant to put it in the modding section (which is actually part of the same larger category, "mapping and modding"), unless the "mods" they used were actually resource packs (or more likely, data packs, which are considered to be mods and not resource packs).
TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.
TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.
Why do I still play in 1.6.4?
I was thinking of using a texture pack to do that because making mods is a little bit complicated
Now I know that it is not possible with texture packs so I'll be working on mods from now on!
Thank you anyways!