Jump to content

[CLOSED][1.18.1] Prevent Mob from being pushed away


Recommended Posts

Posted (edited)

Hey Guys,

i've created a mob which souldn't be pushable by players (or any other mob) or explosions.

i've tried overriding those methods in my entity class:

    @Override
    public boolean canCollideWith(Entity pEntity) {
        return false;
    }

    @Override
    public boolean canBeCollidedWith() {
        return false;
    }

    @Override
    public boolean isPushable() {
        return false;
    }

    @Override
    public boolean isPushedByFluid() {
        return false;
    }

but the mob can still be pushed around by players. Is there any other method i need to override?

Edited by Skyriis
Posted

fixed by overriding the

    @Override
    public void push(Entity pEntity) {

    }

    @Override
    public void push(double pX, double pY, double pZ) {

    }

    @Override
    public boolean ignoreExplosion() {
        return true;
    }

methods as well.

  • Skyriis changed the title to [CLOSED][1.18.1] Prevent Mob from being pushed away

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.