Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Vanilla implementation of the walking mobs #178

Open
yoraze opened this issue Sep 5, 2019 · 0 comments
Open

Vanilla implementation of the walking mobs #178

yoraze opened this issue Sep 5, 2019 · 0 comments

Comments

@yoraze
Copy link

yoraze commented Sep 5, 2019

Description

Did you notice that mobs load the server very much?
Vanilla servers deal with this problem like this: if there are no players next to the mob, the mob does not move until the players approach it.

Justification

This should significantly reduce the load on the server.

Alternative methods

Some check is required to see if there are any players nearby. If there are more than 0, the mob moves; if it is not, the mob does not move.

if(count($this->getViewers()) > 0){
    // Perhaps this is not correct.
    $this->onBehaviorUpdate();
}

Additionally

  • The text has been translated using Google. I hope he translated everything correctly.
  • Perhaps these changes will cause MobSpawner-> despawnMobs () to become meaningless, which will be a very good upgrade. My players really didn’t like that mobs disappear when they go far from home. :(
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants