Jump to content

Recommended Posts

Posted

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.

Posted (edited)

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.

Posted
  On 9/15/2022 at 1: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

Expand  

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.

Posted

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.

Posted
  On 9/18/2022 at 6:02 PM, DirtEngineer said:

I have a similar issue.

Expand  

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.

Posted (edited)

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.

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

    • As a stay-at-home dad and a farmer in Kentucky, my primary focus has always been on nurturing my family and managing our land. When Bitcoin began to gain traction, I saw it as a potential opportunity to secure our financial future. With my wife encouragement, I decided to invest $10,000 from our savings into cryptocurrency. Over time, my investment flourished beyond my wildest dreams, eventually soaring to an astonishing $200,000. Just as I began to feel a sense of financial security, disaster struck. In a shocking act of betrayal fueled by jealousy, my wife hacked into my email and gained access to my Bitcoin wallet. The devastation I felt was overwhelming years of careful planning and smart investing were wiped out in an instant. I was left feeling helpless and uncertain, grappling with the fear that I might never recover what I had lost. In the midst of this turmoil, a close friend reached out to me and mentioned RAPID DIGITAL RECOVERY. Desperate for a solution but still holding onto a glimmer of hope, I contacted them, praying for a lifeline. Their team responded promptly, providing both reassurance and a clear plan of action. With remarkable expertise, they tracked down the digital footprints left by the theft and successfully recovered a substantial portion of my stolen funds. But their assistance didn’t end there. Understanding the vulnerability I felt after such a betrayal, they also offered invaluable advice on how to strengthen my digital security to prevent future breaches. Their support was not just technical; it was a source of empowerment that helped me regain my confidence and sense of control over my financial situation. While the betrayal was a painful lesson, it ultimately taught me resilience and the importance of safeguarding my assets. Thanks to RAPID DIGITAL RECOVERY, I didn’t just reclaim my lost Bitcoin; I also regained my peace of mind. This experience has transformed my perspective on both trust and security in the digital age. I now approach investments with a renewed sense of caution and awareness, ensuring that I protect not only my financial future but also my emotional well-being. The journey has been challenging, but it has also been a testament to my strength and determination to rise above adversity as I continue to balance my roles as a dad and a farmer.
    • Same issue without Oculus Flywheel Compat?
    • When i start my game with a shader active the game crashes with this Error: java.lang.NoSuchFieldError: TESSELATION_SHADERS Minecraft java 1.20.1 in forge 47.4.0 crash report in pastebin: https://pastebin.com/6xiwHqZW thanks in advance
    • If you are using AMD/ATI, update your drivers - get the drivers from their website - do not update via system
    • Not sure why this is happening, but I would love some help. The reason I restarted the server was because I was getting an error while trying to join regarding this "Internal Exception: io.netty.handler.codec.DecoderException: io.netty.handler.codec.EncoderException: java.io.IOException: Root tag must be a named compound tag" Im using ServerMiner if thats any help
  • Topics

×
×
  • Create New...

Important Information

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