Samples - ProjectZulu/JustAnotherSpawner GitHub Wiki

Here's another example that changes the behavior and color of a Mo'Creatures bird.

    "MoCreatures.Bird": {
      "Type-Enabled": "OPENSKY-true",
      "Spawn Operand": "OR",
      "Spawn Tag": "!sky()||(obj.light<6)",
      "Despawn Tags": "isTamed()||block({'iron_bars'},{8,8,8},{0,0,0})",
      "PostSpawn Tags": "writenbt({'TypeInt/3/1'})",
      "Contents": [
        "MoCreatures.Bird"
    }
  • Type-Enabled adds this entity to the OPENSKY group (one of JAS's custom groups).
  • Like with the pig, the spawn operand indicates JAS must override Mo'Creatures default spawning behavior.
  • The spawn tag indicates the bird should spawn everywhere, unless it can see something else than sky, or the ambient light level is below 6.
  • The despawn tag prevents the bird from disappearing if it's tamed, or if it's caged within iron bars.
  • The PostSpawn Tags write an attribute to the bird after it's spawned, in this case changing its color to white. This forces all MoCreatures birds spawned in the game to be white. (There are ways to specify attributes per biome by changing the PostSpawn tags in SpawnListEntries, see the specific example below.)

. . . .

This is an example "Spawn Tag" for Cow in order to have it spawn on Biomes O' Plenty blocks, podzol and others. Spoiler (click to hide)

"Cow": {
"Type-Enabled": "CREATURE-true",
"Spawn Operand": "OR",
"Spawn Tag": "!block({'minecraft:grass','minecraft:dirt','minecraft:dirt','minecraft:dirt','BiomesOPlenty:longGrass',
'BiomesOPlenty:originGrass','minecraft:sand','minecraft:sand',
'minecraft:gravel','minecraft:snow','BiomesOPlenty:hardDirt','BiomesOPlenty:cragRock'},
{0,0,1,2,0,0,0,1,0,0,0,0},
{0,0,0},{0,-1,0})",
"Contents": [
"Cow"
]
},

. . . .

Personal experience, people who want to farm mobs (i.e. with fences) will want to check obj.torchlight as well or they might end up with an insta-despawning farm... :P


"Cow": {
"Type-Enabled": "CREATURE-true",
"Despawn Tags": "block({'fence','nether_brick_fence'},{6,0,6},{0,0,0})",
"InstantDespawn Tags": "(obj.light>7)||(obj.torchlight>6)",
"Contents": [
"Cow"
]
},

. . . .