MobInfo
Link to mobinfo
导入类
Link to 导入类
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.
ZenScript Copyimport mods.zensummoning.MobInfo;
Static Methods
Link to static-methods
Name: create
Creates a new MobInfo with default values.
See other methods for adding more customization.
Same as constructor.
Returns: new MobInfo
Return Type: MobInfo
ZenScript Copy// MobInfo.create() as MobInfo
MobInfo.create();
Constructor #构造函数
Link to constructor-构造函数
No Description Provided
ZenScript Copynew MobInfo() as MobInfo
new MobInfo();
使用方式
Link to 使用方式
Name: mergeData
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
ZenScript Copy// MobInfo.mergeData() as MobInfo
myMobInfo.mergeData();
Name: setCount
Sets the quantity of the mob to be spawned.
Returns: self
Return Type: MobInfo
ZenScript Copy// MobInfo.setCount(count as int) as MobInfo
myMobInfo.setCount(12);
参数 | 类型 | 描述 |
---|---|---|
参数 count | 类型 int | 描述 quantity |
Name: setData
Sets the NBT data of the mobs to be spawned.
Returns: self
Return Type: MobInfo
ZenScript Copy// 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
});
参数 | 类型 | 描述 |
---|---|---|
参数 data | 类型 IData #数据 | 描述 NBT |
Name: setMob
Sets the mob to be spawned.
Returns: self
Return Type: MobInfo
ZenScript Copy// MobInfo.setMob(mob as EntityType) as MobInfo
myMobInfo.setMob("minecraft:zombie_villager");
参数 | 类型 | 描述 |
---|---|---|
参数 mob | 类型 EntityType | 描述 resource location |
Name: setOffset
Sets the offset from the altar where the mobs will be spawned.
Returns: self
Return Type: MobInfo
ZenScript Copy// MobInfo.setOffset(x as float, y as float, z as float) as MobInfo
myMobInfo.setOffset(1, 3, 1);
参数 | 类型 | 描述 |
---|---|---|
参数 x | 类型 float | 描述 x |
参数 y | 类型 float | 描述 y |
参数 z | 类型 float | 描述 z |
Name: setSpread
Sets the random spread for spawning the mob. Values shouldn't be negative.
Returns: self
Return Type: MobInfo
ZenScript Copy// MobInfo.setSpread(x as float, y as float, z as float) as MobInfo
myMobInfo.setSpread(3, 3, 3);
参数 | 类型 | 描述 |
---|---|---|
参数 x | 类型 float | 描述 x spread |
参数 y | 类型 float | 描述 y spread |
参数 z | 类型 float | 描述 z spread |