Walkthrough Part 2 - ProjectZulu/JustAnotherSpawner GitHub Wiki
This will focus on areas from JAS Part 1 as follows:
Lets take a look at a BIOME group example and yes, spawn tags are part of everything.
Pitchbright:
I'm trying to make it so that an animal will despawn when he's out in the water (deep water). So far this has worked for me:
"InstantDespawn Tags": "!liquid({0,0,0},{0,1,0})&&!liquid({0,0,0},{0,-4,0})",
But then I saw an animal despawn while crossing a footbridge that was above water… so that made me think that my tags aren't quite right
I want to make it so that BOTH conditions must be true, in order for the instant despawn to occur. Using my example above, I mean for it to say
"when there is 1 block of liquid above the animals head AND a block of liquid 4 blocks below him"
it seems like what happens is actually an "OR" case, instead of "AND"
What am I doing wrong?
AnvilPuncher:
Hi,
I hope I can help you with what you want to get done For the use of the "InstantDespawn Tags" they need to be set first (usually) by "Despawn Tags" with an expression that needs to be "false" or equal false. For CREATURE types, though, you usually want them to persist and not despawn just because you aren't within so many blocks of them. For situations like that, you need to have your "Despawn Tags" to equal the same conditions that you want in the "InstantDespawn Tags".
For the conditions you want, I am going to assume that you want to have CREATURES such as Cows and Chickens and others despawn instantly when they are have managed to stray out to sea. For this, I'm going to restrict this despawning behavior to a collection of biomes using an attribute group (a very powerful way to select biomes within or outside a biome group.) The attribute groups are found in the BiomeGroups.cfg. Since I use Biomes O' Plenty (BOP), I have the following biomes to be related to the sea. I define the attribute group name as a_DEEPWATER so I can remember why I made it in the first place. Here is the attribute code below:
"Attribute Groups": {
"": {
"a_DEEPWATER": {
"contents": [
"Beach",
"Stone Beach",
"Cold Beach",
"Gravel Beach",
"Snowy Gravel Beach",
"FrozenOcean",
"Deep Ocean",
"Ocean",
"Coral Reef",
"Kelp Forest"
]
}
}
},
Now, the next part of the logic goes into the EntityHandlers folder inside the appropriate file in this case Vanilla.cfg because I will modify this for Chickens. I want the Chickens to despawn when they are inside one of the specified biome groups in the attribute group a_DEEPWATER. I also need them to be actually in the water (I could say any liquid but the sea is full of minecraft:water). Last, I want the water to be deep (4 meters) but also to be without any blocks between the Chicken and the 4th meter of water. I told it to use solidside because there may be kelp or other plants in the water. So the Entity Handler for Chicken should look like this inside Vanilla.cfg:
"Chicken": {
"Type-Enabled": "CREATURE-true",
"Despawn Tags": "!biome('A|a_DEEPWATER',{0,0,0},{0,0,0})||!block({'minecraft:water'},{0,0,0},{0,0,0})||solidside(1,{0,2,0},{0,-2,0})",
"InstantDespawn Tags": "!biome('A|a_DEEPWATER',{0,0,0},{0,0,0})||!block({'minecraft:water'},{0,0,0},{0,0,0})||solidside(1,{0,2,0},{0,-2,0})",
"Contents": [
"Chicken"
]
},
The "InstantDespawn Tags" is very aggressive to despawn and simply removing that line and just having the "Despawn Tags" line allows for the Chickens to despawn after being in the deeper waters of the ocean for too long.