Jump to content

Accessing world from entity


SirXenophon

Recommended Posts

I am creating a custom mob entity similar to a villager and a custom set of villages. The villages are saved in a VillageCollection class that extends WorldSavedData and the entities extend EntityAgeable (similar to vanilla). I want to set an AI task for the villagers of finding the nearest village, but in order to call the VillageCollection class I need to use the static method VillageCollection.get(world). My question is how do I access world from an instance of an EntityAgeable? I've been able to do this for things like break and place events using breakEvent.world and placeEvent.world, so it seems like something similar ought to be possible for living entities (certainly they need access to the world in order to navigate it!).

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.