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

    • how to make animated doors?, maybe geckolib, but i don't know how to code it?
    • For crash 1, set max-tick-time to -1 in your server.properties Crash 2 shows a conflict or incompatibility between LuckPerms and the mod boh-0.0.6.1-forge-1.20.1_2.jar
    • Add the crash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here  
    • so my minecraft crashes when opening my world, i played without any troubles for about 5 days and today it started tweaking.. pls help me
    • Hi guys! I am having some issues with the server crashing over and over and I was hoping to get some guidance.  Thanks in advance! Crash 1: java.lang.Error: ServerHangWatchdog detected that a single server tick took 60.00 seconds (should be max 0.05)     at net.minecraft.server.dedicated.ServerWatchdog.run(ServerWatchdog.java:43) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:classloading}     at java.lang.Thread.run(Thread.java:840) ~[?:?] { Crash 2: java.lang.IllegalStateException: Capability missing for eeb7f026-34b4-42f5-9164-e7736461df83     at me.lucko.luckperms.forge.capabilities.UserCapabilityImpl.lambda$get$0(UserCapabilityImpl.java:66) ~[?:?] {re:classloading,re:classloading,re:classloading}     at net.minecraftforge.common.util.LazyOptional.orElseThrow(LazyOptional.java:261) ~[forge-1.20.1-47.3.10-universal.jar%23222!/:?] {re:mixin,re:classloading}     at me.lucko.luckperms.forge.capabilities.UserCapabilityImpl.get(UserCapabilityImpl.java:66) ~[?:?] {re:classloading,re:classloading,re:classloading}     at me.lucko.luckperms.forge.util.BrigadierInjector$InjectedPermissionRequirement.test(BrigadierInjector.java:143) ~[?:?] {}     at me.lucko.luckperms.forge.util.BrigadierInjector$InjectedPermissionRequirement.test(BrigadierInjector.java:129) ~[?:?] {}     at com.mojang.brigadier.tree.CommandNode.canUse(CommandNode.java:65) ~[brigadier-1.1.8.jar%2376!/:?] {}     at com.mojang.brigadier.CommandDispatcher.parseNodes(CommandDispatcher.java:359) ~[brigadier-1.1.8.jar%2376!/:?] {}     at com.mojang.brigadier.CommandDispatcher.parse(CommandDispatcher.java:349) ~[brigadier-1.1.8.jar%2376!/:?] {}     at com.mojang.brigadier.CommandDispatcher.parse(CommandDispatcher.java:317) ~[brigadier-1.1.8.jar%2376!/:?] {}     at net.minecraft.commands.Commands.m_230957_(Commands.java:237) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:classloading}     at net.mcreator.boh.procedures.TeleportbenProcedure.lambda$execute$2(TeleportbenProcedure.java:65) ~[boh-0.0.6.1-forge-1.20.1_2.jar%23165!/:?] {re:classloading}     at net.mcreator.boh.BohMod.lambda$tick$2(BohMod.java:96) ~[boh-0.0.6.1-forge-1.20.1_2.jar%23165!/:?] {re:classloading}     at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?] {re:mixin}     at net.mcreator.boh.BohMod.tick(BohMod.java:96) ~[boh-0.0.6.1-forge-1.20.1_2.jar%23165!/:?] {re:classloading}     at net.mcreator.boh.__BohMod_tick_ServerTickEvent.invoke(.dynamic) ~[boh-0.0.6.1-forge-1.20.1_2.jar%23165!/:?] {re:classloading,pl:eventbus:B}     at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar%2352!/:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2352!/:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2352!/:?] {}     at net.minecraftforge.event.ForgeEventFactory.onPostServerTick(ForgeEventFactory.java:950) ~[forge-1.20.1-47.3.10-universal.jar%23222!/:?] {re:classloading}     at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:835) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:A}     at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:661) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:A}     at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:A}     at java.lang.Thread.run(Thread.java:840) ~[?:?] {}
  • Topics

×
×
  • Create New...

Important Information

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