I'm playing Minecraft 1.13, and I want to randomly spawn Shulkers on the outer end islands, whilst obeying the mobcap. My idea to do this, was to convert random Endermen into Shulkers, using some form of chance and randomisation. after each cycle, all Endermen would get a tag, indicating that they have already been addressed by the commands, so that not all Endermen end up as Shulkers.
The first step for this, would be to find all the Endermen on the outer end islands. This is where things go wrong (already).
My first find was that command blocks in the Overworld can't address any mobs in the End. To solve this, I made my command into a function and subscribed my function to the GameLoopFunction
gamerule. In this function, I was able to address all the Endermen in the end using the following command:
execute as @e[type=enderman,nbt={Dimension:1}] run say @s
Now in order to only address the Endermen on the outer islands, I have to execute my command at location 0 0 0 and then address all the Endermen that are over 256 blocks away from this point. I ran following command to test if my command still worked if I used this offset:
execute offset 0 0 0 as @e[type=enderman,nbt={Dimension:1}] run say @s
This was also working fine. To finish the command, I added a distance parameter to the target selector like this:
execute offset 0 0 0 as @e[type=enderman,nbt={Dimension:1},distance=256..] run say @s
Unfortunately, no Endermen was addressed at all. I expected to get no result on the main Island, but I expected my chat to overload as soon as I arrived at the outer end islands. The chat remained empty.
NOTE: All previous commands were executed while I was at the outer end islands.
To Ensure that the distance
parameter worked, I did a test in the overworld:
/execute offset 0 0 0 as @e[distance=256..] run say @s
This command should print my name in the chat if I am 256 blocks away from 0 0, which it did, so the distance parameter worked just fine. The question is: How do I address the endermen on the outer end islands?