Jump to content

Recommended Posts

Posted (edited)
 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 by BigWordsScareMe
Posted
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.

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



×
×
  • Create New...

Important Information

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