Simply Swords [Fabric & Forge]

Simply Swords [Fabric & Forge]

23M Downloads

Crash on using throwable weapon on another player

kkellogg378 opened this issue ยท 2 comments

commented

Have you performed isolation testing?
yes

Describe the bug
Game crashes often when hitting a player on a server with a throwable weapon

To Reproduce
Steps to reproduce the behavior:
Download required mods
Enter a server that contains the mods
Have a fellow player join
Grab a throwable weapon (frost hammer for example)
Right click to throw weapon
Game crashes

Expected behavior
Game does not crash

Screenshots
If applicable, add screenshots to help explain your problem.

Additional Info:

  • Modloader: Fabric
  • Modloader Version: 0.16.14
  • Minecraft Version: 1.21.1
  • Mod Version: 1.60.11
  • Environment: Multiplayer

crashlog.txt

Additional context
Add any other context about the problem here.

commented

Was able to fix by changing line 241 in ThrownSpearEntity.java from
if (!stack.isEmpty() && this.getOwner() instanceof LivingEntity livingOwner) {
to
if (stack != null && !stack.isEmpty() && this.getOwner() instanceof LivingEntity livingOwner) {
and line 222 in ThrownSwordEntity.java from
if (!stack.isEmpty() && this.getOwner() instanceof LivingEntity livingOwner) {
to
if (stack != null && !stack.isEmpty() && this.getOwner() instanceof LivingEntity livingOwner) {

commented

Was able to fix by changing line 241 in ThrownSpearEntity.java from if (!stack.isEmpty() && this.getOwner() instanceof LivingEntity livingOwner) { to if (stack != null && !stack.isEmpty() && this.getOwner() instanceof LivingEntity livingOwner) { and line 222 in ThrownSwordEntity.java from if (!stack.isEmpty() && this.getOwner() instanceof LivingEntity livingOwner) { to if (stack != null && !stack.isEmpty() && this.getOwner() instanceof LivingEntity livingOwner) {

Hi there,
Did you experience any additional issues after you applied this fix? I think there might be an underlying issue if the stack is returning null at all, but I'd be interested to hear if you had any further issues.