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

 

good days

 

i been working in a custome villager, and end in the conclusion than the best way to make it spawn in all the villages including mod villages is to catch the event when a vainilla villager spawns in the world and spawns mi villager in that same spot.

 

but for reasons i end whith villages whith 10 vainilla villagers and 200 of mi custome villagers when there must be like three or four  max 6

 

 

i been using this

i tink for some reason is trigering more than one time per spawned villager

 

// ########################################################################################################################3
// replace mobs
@SubscribeEvent
public void onEntityEnter(EnteringChunk event) {

	boolean disable = false;
	boolean enable = true;

	if ( enable & event.entity instanceof EntityVillager & !(event.entity instanceof aldeanoMercenario )) {

		int R = ((int) (Math.random() * 100));


		if (R < 60)
		{

			mercenarymod.entidades.aldeanoMercenario aldeanoMercenario = new mercenarymod.entidades.aldeanoMercenario(event.entity.worldObj);

			aldeanoMercenario.setPosition(event.entity.posX, event.entity.posY, event.entity.posZ);
			event.entity.worldObj.spawnEntityInWorld(aldeanoMercenario);
			//event.entity.setDead();
		}

	}
	}

 

 

 

¿¿¿ another event bether suited for this or another solution  would be very apreciated

 

Thanks for reading

 

EntityJoinWorldEvent

is fired when an entity is spawned in the world. You can cancel it to prevent the entity from spawning.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.