Jump to content

Mob / Entity questions


DanilaFE

Recommended Posts

I have a few questions regarding a mod I'm making, and the mobs inside it.

 

Question 1

Is there an event that fires on death of a mob? How can I access it?

 

Question 2

How would I create a new entity at the location of the old one, when it dies?

 

Question 3

How can I make an entity countdown, and at the end with a chance of, say, 1 in 3, spawn another mob/entity and destroy itself?

 

Question 4

Is it possible for an entity to change into another entity when it’s RIGHT CLICKED

 

Question 5

How would I add a custom task for a mob, for example sticking around another mob

 

Question 6

How do I have mobs pick up blocks?

 

Question 7

How do I have mobs place blocks? In a certain formation, like build a castle?

 

That’s about it. Answer as many as you can.

“Since when did you start modding?”

“Last night"

Link to comment
Share on other sites

1) I believe so.  May have to tie into the "Hurt" event and check to see if the entity would die

2) Yes!  Most certainly.

3) Absolutely!

4) With finagling and magical voodoo it would be possible (read: yes, but tricky.  Know what you're doing first)

5) You'd need to create a new AI event and know how to program it.  You might be able to get away with the behavior that causes wolves to hunt sheep.

6) Look at the Enderman

7) See 6.  As for formations, that would require a really good AI structure.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

1/LivingDeathEvent or EntityLivingBase#onDeath(DamageSource)

2/World#spawnEntityInWorld(Entity)

3/Entity.ticksExisted is an already existing countdown that you can use in Entity#onUpdate()

4/Entity#onInteractFirst for the right click

5/EntityLiving#targetTasks#addTask(int, EntityAI)

Link to comment
Share on other sites

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.