Jump to content

[1.19.2] Bow animation doesn't work.


Lior Hassin

Recommended Posts

I am trying to create a custom bow as a practice with some range weapons.

The bow itself work just fine, but the pulling animation is not working.

Github repository : https://github.com/liorhassin/RPG-Mod

Files navigation in github that could be related to the issue:

1) main/rpgmod/rpgmod.java (I think the issue could be related to the onClientSetup function that doesn't seem to change anything/load my addCustomItemProperties)

2) main/rpgmod/util/ModItemProperties.java (Where I wrote the code to be like the classic bow from minecraft)

3) resource/assets/rpgmod/models/item/beginner_bow.json (Where I wrote the json file to describe the animation and position of the item)

4) resource/assets/rpgmod/models/item/beginner_bow_pulling_0 , 1 , 2 (all animations linked to main item parent but call different png to create the bow animation)

Thanks in advance.

Link to comment
Share on other sites

You are registering ItemProperties against the vanilla bow (Items.BOW) instead of the passed in item.

https://github.com/liorhassin/RPG-Mod/blob/3d693c2b4c0c6fd9190bfe18c3cd4d79585556cd/src/main/java/net/LiorNadav/rpgmod/util/ModItemProperties.java#L16

 

And, the ItemProperties.register() is not theadsafe - it updates a HashMap. So you need to put the call inside an event.enqueueWork() like you do for your registerPOIs().

 

Unrelated:

You are missing a value=Dist.CLIENT here: https://github.com/liorhassin/RPG-Mod/blob/3d693c2b4c0c6fd9190bfe18c3cd4d79585556cd/src/main/java/net/LiorNadav/rpgmod/RPGMod.java#L55

which means your mod will crash on a server when it tries to access client only classes.

You already have somewhere where you could put this event listener that is correctly defined:

https://github.com/liorhassin/RPG-Mod/blob/3d693c2b4c0c6fd9190bfe18c3cd4d79585556cd/src/main/java/net/LiorNadav/rpgmod/event/ClientEvents.java#L26

Edited by warjort
  • Like 1

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

I have a similar issue.
I made a weapon that extends BowItem.  The item animations work, but the screen doesn't zoom in like when you use the regular Bow.
Not sure if OP is having the same issue, but it may be related.
Github repository: https://github.com/DirtEngineers/Squirtgun-1.19

New to the forum, so let me know if I should move this to a fresh post.

Link to comment
Share on other sites

On 9/15/2022 at 4:00 PM, warjort said:

You are registering ItemProperties against the vanilla bow (Items.BOW) instead of the passed in item.

https://github.com/liorhassin/RPG-Mod/blob/3d693c2b4c0c6fd9190bfe18c3cd4d79585556cd/src/main/java/net/LiorNadav/rpgmod/util/ModItemProperties.java#L16

 

And, the ItemProperties.register() is not theadsafe - it updates a HashMap. So you need to put the call inside an event.enqueueWork() like you do for your registerPOIs().

 

Unrelated:

You are missing a value=Dist.CLIENT here: https://github.com/liorhassin/RPG-Mod/blob/3d693c2b4c0c6fd9190bfe18c3cd4d79585556cd/src/main/java/net/LiorNadav/rpgmod/RPGMod.java#L55

which means your mod will crash on a server when it tries to access client only classes.

You already have somewhere where you could put this event listener that is correctly defined:

https://github.com/liorhassin/RPG-Mod/blob/3d693c2b4c0c6fd9190bfe18c3cd4d79585556cd/src/main/java/net/LiorNadav/rpgmod/event/ClientEvents.java#L26

Sorry for the delay busy with my exams.

Thank you very much for the help, Fixed all client related stuff to that one file that got Dist.client there.

also its much cleaner now and easy to understand.
fixing the ItemPropeties.register() if you could tell me on which file you see that problem, I couldn't find the file with ItemPropeties.register() and also has the event parameter in it so I can fix that problem.
Also having issue with rendering my new arrow when it fly, will dig into it later.

Again super thank you for helped me understand my issue quickly.

Link to comment
Share on other sites

I linked it above, you need to change Items.BOW to item

- ItemProperties.register(Items.BOW, new ResourceLocation("pull"), (itemStack, level, entity, i) -> {
+ ItemProperties.register(item, new ResourceLocation("pull"), (itemStack, level, entity, i) -> {

 

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

39 minutes ago, DirtEngineer said:

I have a similar issue.

Please start your own thread.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

The same code. Those ItemProperties.registers needs to be called within an enqueueWork() so they run on the main render thread instead of concurrently with other mods doing the same thing.

Edited by warjort
  • Thanks 1

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I was just trying to play my modded world when i randomly got this crash for no reason. I sorted through like every mod and eventually I realized it was LLibrary but I can't seem to find a solution to fix the crashing. I can't lose the world that I have that uses this mod please help me. Here's the report: https://pastebin.com/0D00B79i If anyone has a solution please let me know.  
    • 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑   Daftar Slot Ligawin88 adalah bocoran slot rekomendasi gacor dari Ligawin88 yang bisa anda temukan di SLOT Ligawin88. Situs SLOT Ligawin88 hari ini yang kami bagikan di sini adalah yang terbaik dan bersiaplah untuk mengalami sensasi tak terlupakan dalam permainan slot online. Temukan game SLOT Ligawin88 terbaik dengan 100 pilihan provider ternama yang dipercaya akan memberikan kepuasan dan kemenangan hari ini untuk meraih x500. RTP SLOT Ligawin88 merupakan SLOT Ligawin88 hari ini yang telah menjadi pilihan utama bagi pemain judi online di seluruh Indonesia. Setiap harinya jutaan pemain memasuki dunia maya untuk memperoleh hiburan seru dan kemenangan besar dalam bermain slot dengan adanya bocoran RTP SLOT Ligawin88. Tidak ada yang lebih menyenangkan daripada mengungguli mesin slot dan meraih jackpot x500 yang menggiurkan di situs SLOT Ligawin88 hari ini yang telah disediakan SLOT Ligawin88. Menangkan jackpot besar x500 rajanya maxwin dari segala slot dan raih kemenangan spektakuler di situs Ligawin88 terbaik 2024 adalah tempat yang menyediakan mesin slot dengan peluang kemenangan lebih tinggi daripada situs slot lainnya. Bagi anda yang mencari pengalaman judi slot paling seru dan mendebarkan, situs bo SLOT Ligawin88 terbaik 2024 adalah pilihan yang tepat. Jelajahi dunia slot online melalui situs SLOT Ligawin88 di link SLOT Ligawin88.
    • 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑   Daftar Slot Asusslot adalah bocoran slot rekomendasi gacor dari Asusslot yang bisa anda temukan di SLOT Asusslot. Situs SLOT Asusslot hari ini yang kami bagikan di sini adalah yang terbaik dan bersiaplah untuk mengalami sensasi tak terlupakan dalam permainan slot online. Temukan game SLOT Asusslot terbaik dengan 100 pilihan provider ternama yang dipercaya akan memberikan kepuasan dan kemenangan hari ini untuk meraih x500. RTP SLOT Asusslot merupakan SLOT Asusslot hari ini yang telah menjadi pilihan utama bagi pemain judi online di seluruh Indonesia. Setiap harinya jutaan pemain memasuki dunia maya untuk memperoleh hiburan seru dan kemenangan besar dalam bermain slot dengan adanya bocoran RTP SLOT Asusslot. Tidak ada yang lebih menyenangkan daripada mengungguli mesin slot dan meraih jackpot x500 yang menggiurkan di situs SLOT Asusslot hari ini yang telah disediakan SLOT Asusslot. Menangkan jackpot besar x500 rajanya maxwin dari segala slot dan raih kemenangan spektakuler di situs Asusslot terbaik 2024 adalah tempat yang menyediakan mesin slot dengan peluang kemenangan lebih tinggi daripada situs slot lainnya. Bagi anda yang mencari pengalaman judi slot paling seru dan mendebarkan, situs bo SLOT Asusslot terbaik 2024 adalah pilihan yang tepat. Jelajahi dunia slot online melalui situs SLOT Asusslot di link SLOT Asusslot.
    • 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 Daftar Slot Galeri555 adalah bocoran slot rekomendasi gacor dari Galeri555 yang bisa anda temukan di SLOT Galeri555. Situs SLOT Galeri555 hari ini yang kami bagikan di sini adalah yang terbaik dan bersiaplah untuk mengalami sensasi tak terlupakan dalam permainan slot online. Temukan game SLOT Galeri555 terbaik dengan 100 pilihan provider ternama yang dipercaya akan memberikan kepuasan dan kemenangan hari ini untuk meraih x500. RTP SLOT Galeri555 merupakan SLOT Galeri555 hari ini yang telah menjadi pilihan utama bagi pemain judi online di seluruh Indonesia. Setiap harinya jutaan pemain memasuki dunia maya untuk memperoleh hiburan seru dan kemenangan besar dalam bermain slot dengan adanya bocoran RTP SLOT Galeri555. Tidak ada yang lebih menyenangkan daripada mengungguli mesin slot dan meraih jackpot x500 yang menggiurkan di situs SLOT Galeri555 hari ini yang telah disediakan SLOT Galeri555. Menangkan jackpot besar x500 rajanya maxwin dari segala slot dan raih kemenangan spektakuler di situs Galeri555 terbaik 2024 adalah tempat yang menyediakan mesin slot dengan peluang kemenangan lebih tinggi daripada situs slot lainnya. Bagi anda yang mencari pengalaman judi slot paling seru dan mendebarkan, situs bo SLOT Galeri555 terbaik 2024 adalah pilihan yang tepat. Jelajahi dunia slot online melalui situs SLOT Galeri555 di link SLOT Galeri555.
    • 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 Daftar Slot Kocok303 adalah bocoran slot rekomendasi gacor dari Kocok303 yang bisa anda temukan di SLOT Kocok303. Situs SLOT Kocok303 hari ini yang kami bagikan di sini adalah yang terbaik dan bersiaplah untuk mengalami sensasi tak terlupakan dalam permainan slot online. Temukan game SLOT Kocok303 terbaik dengan 100 pilihan provider ternama yang dipercaya akan memberikan kepuasan dan kemenangan hari ini untuk meraih x500. RTP SLOT Kocok303 merupakan SLOT Kocok303 hari ini yang telah menjadi pilihan utama bagi pemain judi online di seluruh Indonesia. Setiap harinya jutaan pemain memasuki dunia maya untuk memperoleh hiburan seru dan kemenangan besar dalam bermain slot dengan adanya bocoran RTP SLOT Kocok303. Tidak ada yang lebih menyenangkan daripada mengungguli mesin slot dan meraih jackpot x500 yang menggiurkan di situs SLOT Kocok303 hari ini yang telah disediakan SLOT Kocok303. Menangkan jackpot besar x500 rajanya maxwin dari segala slot dan raih kemenangan spektakuler di situs Kocok303 terbaik 2024 adalah tempat yang menyediakan mesin slot dengan peluang kemenangan lebih tinggi daripada situs slot lainnya. Bagi anda yang mencari pengalaman judi slot paling seru dan mendebarkan, situs bo SLOT Kocok303 terbaik 2024 adalah pilihan yang tepat. Jelajahi dunia slot online melalui situs SLOT Kocok303 di link SLOT Kocok303.
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.