Skip to content

hurtAndBreak not working properly on curios item #355

Answered by TheIllusiveC4
s1avko asked this question in Q&A
Discussion options

You must be logged in to vote

Where is your ticksPassed being stored? If it's somewhere where both the client and server threads are able to access it, then you may be suffering from a concurrency issue where the client thread is processing information that the server needs before the server can access it.

I'd advise changing your ticksPassed logic to instead check against the player's tick count, player.tickCount % 200 == 0. In addition, check either !livingEntity.level().isClientSide() or livingEntity instanceof ServerPlayer to only run it on the server thread.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@s1avko
Comment options

Answer selected by s1avko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants