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.

Featured Replies

Posted

My Entity for some reason I do not know does not move when the player is riding it.

 

Purpose of the Entity: A mode of transportation for the player, it can fly and no fall damage is to be received when mid-flight fall.

 

[spoiler=Entity Class]

public class EntityGreenGoblinGlider extends EntityCreature
{
    /** AI task for player control. */
    private final EntityAIControlledByPlayer aiControlledByPlayer;
    
    public EntityGreenGoblinGlider(World worldIn)
    {
        super(worldIn);
        this.tasks.addTask(0, this.aiControlledByPlayer = new EntityAIControlledByPlayer(this, 10.0F));
    }

    @Override
    protected void applyEntityAttributes()
    {
        super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);
    }

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

    @Override
    public boolean interact(EntityPlayer player)
    {
        if (super.interact(player))
        {
            return true;
        }
        else if (this.worldObj.isRemote || this.riddenByEntity != null && this.riddenByEntity != player)
        {
            return false;
        }
        else
        {
            player.mountEntity(this);
            return true;
        }
    }

    /**
     * Return the AI task for player control.
     */
    public EntityAIControlledByPlayer getAIControlledByPlayer()
    {
        return this.aiControlledByPlayer;
    }
}

 

 

 

Where did I go wrong?

width=620 height=260http://www.startrek.com/uploads/assets/articles/61c89a9d73c284bda486afaeaf01cdb27180359b.jpg[/img]

Till next time. Thank you for delivering funny scenes to Star Trek as Chekov :) . Will always remember you

Im sorry but i dont have the fix for it,

When an entity is ridden from what i know it cancels all

Ai stuff.. if i were you i would start by looking at the way of

Adding player control when its ridden... it seems that in this

time there arent any moderators online which is a bit sad

Because usally people come here as last way of help and in

Some timezones it could take the whole day if you are not working

Im something else meanwhile...

 

#phonekeyboard

Doing stuff n' things

  • 2 weeks later...

Actually you did initialize it i didnt seenit and of course it does otherwise you would pass in a null object. Try overriding getControllingPassenger

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author

Actually you did initialize it i didnt seenit and of course it does otherwise you would pass in a null object. Try overriding getControllingPassenger

 

getControllingPassenger does not exists in EntityCreature, EntityLiving, EntityLivingBase and Entity.

width=620 height=260http://www.startrek.com/uploads/assets/articles/61c89a9d73c284bda486afaeaf01cdb27180359b.jpg[/img]

Till next time. Thank you for delivering funny scenes to Star Trek as Chekov :) . Will always remember you

Try basing it off EntityHorse because AIControlledByPlayer seems to be used for EntityPig and the Carrot On A Stick item.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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.