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

Hi!

 

I am making a mythical horses mod, and have made all of the mobs.

Now, I am trying hard to make them rideable (by right clicking, no saddle),

but I just can't seem to do it!

 

I can't get the mob class up right now (sorry :-/), but I will be able to in a day

or so.

 

If anyone knows how to make a rideable mob, can you post an example class?

I know this is asking a lot :-/ but it would be incredibly helpful if you could!

I. Am. A. Noob.

Noobs. :P

What are you subclassing from?  If you're creating a type of horse, then I would have thought simply subclassing EntityHorse and adding whatever extra things you need would be easiest - all of the code pertaining to riding behavior is already done for you.

Geek girl and professional code wrangler, but new to Forge.

  • Author

What are you subclassing from?  If you're creating a type of horse, then I would have thought simply subclassing EntityHorse and adding whatever extra things you need would be easiest - all of the code pertaining to riding behavior is already done for you.

 

The very sad part is: ... it's very sad... I can't find the EntityHorse Class.  :-[

I. Am. A. Noob.

Noobs. :P

net.minecraft.entity.passive.EntityHorse

1.7.10 is no longer supported by forge, you are on your own.

  • Author

What if I didn't want a saddle or horse GUI- just right click and I'm riding?

 

I. Am. A. Noob.

Noobs. :P

I would imagine you just override isHorseSaddled to always return true :

 

    public boolean isHorseSaddled()
    {
        return true;
    }

 

I haven't tried that though, YMMV.  I'm also new to Forge and finding that taking a look through the Minecraft/Forge source helps immensely.

Geek girl and professional code wrangler, but new to Forge.

  • Author

It didn't work...

 

but so far, here is my class:package com.camp.entity;

 

import com.camp.item.ItemManager;

 

import net.minecraft.entity.SharedMonsterAttributes;

import net.minecraft.entity.ai.EntityAISwimming;

import net.minecraft.entity.ai.EntityAIWander;

import net.minecraft.entity.passive.EntityHorse;

import net.minecraft.world.World;

 

public class UnicornMob extends EntityHorse {

public boolean stationary;

 

public UnicornMob(World worldIn) {

super(worldIn);

 

this.tasks.addTask(0, new EntityAISwimming(this));

this.tasks.addTask(1, new EntityAIWander(this, 1.0D));

 

}

 

protected void applyEntityAttributes() {

super.applyEntityAttributes();

 

this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(30.0D);

this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3d);

 

}

 

@Override

public void dropFewItems(boolean recentlyHit, int lootLevel) {

int quantity = this.rand.nextInt(4) + 1;

 

for (int i = 0; i < quantity; i++) {

if (this.isBurning()) {

            this.dropItem(ItemManager.unicornHorn, 1);

        }

        else {

            this.dropItem(ItemManager.unicornHorn, 1);

        }

}

}

 

public boolean isAIEnabled() {

return true;

}

 

}

 

I. Am. A. Noob.

Noobs. :P

Err, i don't see that you've put the override in anywhere?

 

Like this:

 

import com.camp.item.ItemManager;

 

import net.minecraft.entity.SharedMonsterAttributes;

import net.minecraft.entity.ai.EntityAISwimming;

import net.minecraft.entity.ai.EntityAIWander;

import net.minecraft.entity.passive.EntityHorse;

import net.minecraft.world.World;

 

public class UnicornMob extends EntityHorse {

  public boolean stationary;

 

  public UnicornMob(World worldIn) {

      super(worldIn);

 

      this.tasks.addTask(0, new EntityAISwimming(this));

      this.tasks.addTask(1, new EntityAIWander(this, 1.0D));

 

  }

 

  @Override

  public boolean isHorseSaddled()

    {

        return true;

    }

 

  protected void applyEntityAttributes() {

      super.applyEntityAttributes();

 

      this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(30.0D);

      this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3d);     

 

  }

 

  @Override

  public void dropFewItems(boolean recentlyHit, int lootLevel) {

      int quantity = this.rand.nextInt(4) + 1;

     

      for (int i = 0; i < quantity; i++) {

        if (this.isBurning()) {

              this.dropItem(ItemManager.unicornHorn, 1);

          }

          else {

              this.dropItem(ItemManager.unicornHorn, 1);

          }

      }

  }

 

  public boolean isAIEnabled() {

      return true;

  }

 

}

 

Geek girl and professional code wrangler, but new to Forge.

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.