TransWikia.com

How to make a modified mob spawn randomly on the map?

Arqade Asked by LPA 3227 on August 22, 2020

I’m doing a RPG in minecraft with some friends but we don’t know how to make a modified mob spawn randomly on the map. We have a mob, and we have set it’s name, attributes, and other data. But we don’t know how to get it in a random location.

We are playing in Minecraft JE 1.16.1.

One Answer

Use /summon to summon the entity normally. But immediately after, run the following /spreadplayers command:

/spreadplayers <centerX> <centerZ> 0.0 <maxRange> false @e[name="THE_MOB_TO_ACT_UPON"]

Replace the following things:

  • centerX and centerZ: The centre of your arena.
  • maxRange: How far from the centre can your entity be? The area is a square radius.
  • The target selector at the end: Replace with a target selector that will target the entity that you've already summoned.

Correct answer by ExpertCoder14 on August 22, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP