Posted May 20, 20205 yr protected void findNearestTarget() { if (this.targetClass != PlayerEntity.class && this.targetClass != ServerPlayerEntity.class) { this.nearestTarget = this.goalOwner.world.<T>func_225318_b(this.targetClass, this.targetEntitySelector, this.goalOwner, this.goalOwner.getPosX(), this.goalOwner.getPosYEye(), this.goalOwner.getPosZ(), this.getTargetableArea(this.getTargetDistance())); } else { this.nearestTarget = this.goalOwner.world.getClosestPlayer(this.targetEntitySelector, this.goalOwner, this.goalOwner.getPosX(), this.goalOwner.getPosYEye(), this.goalOwner.getPosZ()); if (PlayerAssignEvent.PlayerAssignIds.get(PlayerEntity.getUUID(((PlayerEntity) nearestTarget).getGameProfile())) == false) { this.nearestTarget = null; } } } This is in the Goal/AI class. I just copied and pasted the normal NearestAttackableTargetGoal. My inention is as the title states, I want to make a mob that attacks only certain players. The game keeps crashing upon summoning the entity with this goal, even when I remove the this.nearestTarget = null; line. Here is the latest log. https://pastebin.com/vtyyavw4 Anyone help with how to do this would be appreciated! Edited May 20, 20205 yr by BigWordsScareMe
May 20, 20205 yr Author 1 hour ago, diesieben07 said: Show your complete goal class. https://pastebin.com/iGNGeYtf Edited May 20, 20205 yr by BigWordsScareMe
May 21, 20205 yr Author 1 hour ago, diesieben07 said: Step one: Fix this. This is not your package. This is the code that is failing. Something here is null. What is PlayerAssignEvent? wtf is that code? I fixed it. I just moved the if statement to a different area in that same file and it worked just fine
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.