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

I tried to create a simple cube as entity.

The entity is not really "living", it has no health, can get no damage, and it is flying not walking.

How should I realize that?

 

1. Should I use Entity or EntityLiving as super class?

2. If not EntityLiving, how can I properly render it?

3. If EntityLiving, how can I properly render it?

4. How can I use the Minecraft Pathfinding for my entity?

5. Do you know a way to let the flying not look straight and linear?

 

my suggestion is

1) get MCP ,

2) decompile Minecraft,

3) have a look at the enderdragon, and bats

 

in particular look at where they differ from the other entitys, since they are flying entities

 

 

 

I believe what you want is a standart entity.

Just make it an entity.

It will fly automatically.

You should use super class depending your needs so do comparing between classes. Look tutorials for custom mob rendering, that should help you with rendering. And no, you cannot use MC pathfinding for flying entities because pathfinder is made for entities in the ground so it tries to create path that is on the ground. You can create your own pathfinder AI task or use something from EntityGhast. With trigonometry you can create lines that are more "natural" or again, check how EntityGhast changes its position.

Making it move to the player is not difficult.

Look at this easy trick.

 

Put this in your onUpdate() method

 

EntityPlayer player = this.worldObj.getClosestPlayerToEntity(this, 200);

 

if(player.posX >= this.posX){

this.posX += 0.1;

}

if(player.posX <= this.posX){

this.posX -= 0.1;

}

 

Do the same with Y and Z and it will go right to a player.

 

@Override

public boolean isEntityInvulnerable(){

return true;

}

 

this will make the entity unkillable

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.