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 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"

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.

  • Author

How would I go about making 2 and 3?

Could you explain it please?

“Since when did you start modding?”

“Last night"

The death even thats called in the vanilla mobs causes them to drop items. You can change that to spawn a mob, for the countdown you will probably need a tick handler  and after so many ticks the death event can finish.

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)

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.