Home Commands Examples Getting Started With Scripts Global Keywords
Generic JSON Recipes

MobInfo

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import mods.zensummoning.MobInfo;

Static Methods

Creates a new MobInfo with default values.
See other methods for adding more customization.

Same as constructor.

Returns: new MobInfo
Return Type: MobInfo

script.zs
// MobInfo.create() as MobInfo
MobInfo.create();

Constructors

No Description Provided

script.zs
new MobInfo() as MobInfo
new MobInfo();

Methods

Sets the data to be merged with default rather than overwriting the default. Does NOT need to be called after setData.

Returns: self
Return Type: MobInfo

script.zs
// MobInfo.mergeData() as MobInfo
myMobInfo.mergeData();

Sets the quantity of the mob to be spawned.

Returns: self
Return Type: MobInfo

script.zs
// MobInfo.setCount(count as int) as MobInfo
myMobInfo.setCount(12);
ParameterTypeDescription
Parameter
count
Type
int
Description
quantity

Sets the NBT data of the mobs to be spawned.

Returns: self
Return Type: MobInfo

script.zs
// MobInfo.setData(data as IData) as MobInfo
myMobInfo.setData({
"Health":200,
"Attributes":[
{"Name":"generic.maxHealth", "Base":200},
{"Name":"generic.movementSpeed", "Base":0.3},
{"Name":"generic.attackDamage", "Base":6}
],
"CustomName":"A Lost Soul",
"PersistenceRequired":1,
"CustomNameVisible":1
});
ParameterTypeDescription
Parameter
data
Type
IData
Description
NBT

Sets the mob to be spawned.

Returns: self
Return Type: MobInfo

script.zs
// MobInfo.setMob(mob as EntityType) as MobInfo
myMobInfo.setMob("minecraft:zombie_villager");
ParameterTypeDescription
Parameter
mob
Type
EntityType
Description
resource location

Sets the offset from the altar where the mobs will be spawned.

Returns: self
Return Type: MobInfo

script.zs
// MobInfo.setOffset(x as float, y as float, z as float) as MobInfo
myMobInfo.setOffset(1, 3, 1);
ParameterTypeDescription
Parameter
x
Type
float
Description
x
Parameter
y
Type
float
Description
y
Parameter
z
Type
float
Description
z

Sets the random spread for spawning the mob. Values shouldn’t be negative.

Returns: self
Return Type: MobInfo

script.zs
// MobInfo.setSpread(x as float, y as float, z as float) as MobInfo
myMobInfo.setSpread(3, 3, 3);
ParameterTypeDescription
Parameter
x
Type
float
Description
x spread
Parameter
y
Type
float
Description
y spread
Parameter
z
Type
float
Description
z spread