Make mob move towards items on the ground?

Started by Aksumite on

Topic category: Help with modding (Java Edition)

Last seen on 01:21, 23. Aug 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make mob move towards items on the ground?

I am making vultures and want them to move towards certain items, and then destroy them.

Is this possible? Thanks :D

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You will need to create a…
Wed, 06/17/2020 - 01:14

You will need to create a EntityAI

 

For finding item entities;

World::getEntitiesWithinAABB

In one of the parameters specify for ItemEntity. If you want to find a specific item, iterate through the results.

 

Now use;

PathNavigator::getPathToEntity

Use this to travel to an ItemEntity. Once nearby remove it.

 

This thread is shockingly similar to;

@https://mcreator.net/forum/61448/mobs-break-blocks-and-take-block-chest

 

Due to the linked post's "uncertain" title. This is not a "double post".

Last seen on 03:10, 19. Feb 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
tborski thanks I will try to…
Wed, 06/17/2020 - 01:33

tborski thanks

I will try to add this to a plugin I'm working on.

Last seen on 01:21, 23. Aug 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok thanks I will try it out …
Wed, 06/17/2020 - 02:57

Ok thanks I will try it out :D

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
tbroski: I noticed you help…
Wed, 06/17/2020 - 19:24

tbroski: I noticed you help a lot on the website, just wanted to say thanks, this is really nice to see :)

I appreciate the recognition! I started on MCreator so I know how fun it is to create mods using the MCreator software. I love witnessing the ambition of the users to create these interesting mods! Since I basically learned java from MCreator, I feel obligated to help people with coding (when it is not possible in MCreator, not the MCreator teams fault due to the 1000+ tickets). Though, I may do it because I don't want to see someone lose ambition because of it not being applicable in MCreator (again, "when it is not possible in MCreator, not the MCreator teams fault due to the 1000+ tickets").

Anyways, it is fun helping wonderful users. And I am glad to be part of the community, because if I decide to dive into a career that involves coding-- it will all be thanks to MCreator🥰!

Since I basically learned…
Thu, 06/18/2020 - 15:40

Since I basically learned java from MCreator

That is simply awesome to hear! :D

Based on the fact you indeed know Java well based on your responses, maybe consider checking this topic I made on open-sourcing MCreator to get more features faster by more people: https://mcreator.net/forum/62785/survey-contributorsdevelopers-if-mcreator-would-go-open-source 

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have filled out my…
Thu, 06/18/2020 - 16:23

I have filled out my response, I answered each question clearly at the bottom. And I can't wait to help!

Last seen on 22:22, 15. Oct 2020
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Im new to mcreator can you…
Sat, 06/27/2020 - 03:20

Im new to mcreator can you explain where the new code and information would go?

I have filled out my…
Sat, 06/27/2020 - 09:49

I have filled out my response, I answered each question clearly at the bottom. And I can't wait to help!

Nice to hear this, thanks ;)