Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[1.11.2] [SOLVE] Custom Mob not really responding to EntityAI commands

Featured Replies

Posted

So I've listed a the following tasks and when I test run minecraft, my mob just sits there and only once in a while pursues and attacks the player for like 2 seconds, only attacking a maximum of 2 times and then stops and sits there again. I have extended the custom mob's EntityClass to EntityMob and have declared a damage amount already. 

Here is the entity class

public EntityChimera(World world) {
		super(world);
		this.tasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true, true));
		this.tasks.addTask(1, new EntityAIAttackMelee(this, 1.0D, true));
		
		this.tasks.addTask(2, new EntityAIMoveTowardsRestriction(this, 1.0D));
		this.tasks.addTask(4, new EntityAIWander(this, 1.5D));
		this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 20f));
		this.tasks.addTask(6, new EntityAILookIdle(this));
		
		setSize(2.0F, 2.0F);

	}

More than anything, the mob just sits there and does nothing. I've watched a multitude of tutorials, but it doesn't seem like any of them do something different. Maybe I missed it, but I don't think so.

I'm trying to get my mob to hunt down the player like all other mobs, but I think I'm missing something

 

EDIT: turns out that when I edited it, I took out the AttackMelee task

Edited by GooberGunter

  • Author
public EntityChimera(World world) {
		super(world);
		this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true, true));
		this.targetTasks.addTask(1, new EntityAIAttackMelee(this, .25D, true));
		
		this.tasks.addTask(2, new EntityAIMoveTowardsRestriction(this, .25D));
		this.tasks.addTask(4, new EntityAIWander(this, .25D));
		this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 20f));
		this.tasks.addTask(6, new EntityAILookIdle(this));
		
		setSize(2.0F, 2.0F);

	}

I fixed it but it still just sits there and runs around once in a great while, it still doesn't attack the player

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.