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

Hello, I'm current Attempting to implement 2 new mob types, one of which I'm planning to have mounted on a horse, and the other a ranged attacker.. 

 

Archer Villager

 

public class EntityVillagerArcher extends EntityVillagerSoldier implements IRangedAttackMob{

 

Horse Mounted Villager:

public class EntityVillagerCaptain extends EntityVillagerSoldier{

 

Completed Melee Villager:

public class EntityVillagerSoldier extends EntityVillager{

 

On the topic of the horse mounted Villager

 

I've attempted to copy some code from the spider class replacing the spider references with a new horse, but all it does is freeze my EntityVillagerCaptain once it's spawned. 

 

 EntityHorse horse = new EntityHorse(this.world);
	        horse.setPosition(this.posX, this.posY, this.posZ);
	        this.world.spawnEntity(horse);
	        this.startRiding(horse);

 

Some Notes:

The EntityVillagerCaptain jerks his arms and legs around rapidly.

The horse is nowhere to be seen.

And upon some debugging, the message:

[16:42:28] [Client thread/WARN]: Received passengers for unknown entity

IS also displayed in the console each to a EntityVillagerCaptain is spawned.

 

Is there something I'm doing wrong, or is there a better way to do this?

 

On the topic of the Archer Villager

My main problem is that the EntityAIAttackRangedBow requires the class to be an instance of the Abstract Skeleton Class .

However I can't make my Archers extend this class as my villager soldiers will start attacking them.

 

EntityAIAttackRangedBow(AbstractSkeleton skeleton, double speedAmplifier, int delay, float maxDistance)

 

Should I just make my own custom AI? or is there a workaround to my current problem with Villager Archer?

 

Thanks.

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.