Jump to content

[1.12.2]Custom entity does not attack


Robertusxd

Recommended Posts

So my problem is that my Entity does not attack. Its not just dealing no damage it does not even move towards the target or do anything at all really.

 

Entity: https://pastebin.com/d9dAzjM0

EntityNeutral: https://pastebin.com/R2R1Raqx

WalkHomeAi: https://pastebin.com/1ECiWBsD

AttackAI: https://pastebin.com/08Xvq8tt

 

But i dont think it is a problem with my AI since i also tried Minecrafts AIs EntityAIHurtByTarget and EntityAINearestAttackableTarget and they didnt work either. I also used System.out.println to see if the setattacktarget method of my entity is called and it does get called.

Edited by Robertusxd
Link to comment
Share on other sites

32 minutes ago, Ugdhar said:

You're in survival mode right? I know I added a mob tinkering around one time, and it didn't do much because I was in creative mode. After I switched it to SV, the 20 or so mobs I had spawned all bumrushed me at once. . .

yes im in survival mode

as i said the setAttackTarget method of the entity gets called but the entity does not react to it.

Link to comment
Share on other sites

You never seem to set any actual attack AI. The targeting AI just sets the target but doesn't do any movement or attack. You need something like EntityAIAttackMelee() also added to the tasks list. In other words, the targeting and the actual attack are meant to be separate AI and if you want the entity to move towards the target you need to add that AI as well.

  • Like 2

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

7 hours ago, jabelar said:

You never seem to set any actual attack AI. The targeting AI just sets the target but doesn't do any movement or attack. You need something like EntityAIAttackMelee() also added to the tasks list. In other words, the targeting and the actual attack are meant to be separate AI and if you want the entity to move towards the target you need to add that AI as well.

you are my hero right now, thank you so much

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



×
×
  • Create New...

Important Information

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