Arqade Asked by D-Inventor on November 9, 2020
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?
When you use a selector that includes dimension-binding parameters (x/y/z/dx/dy/dz/distance
), the dimension of execution will be restricted to the command sender's dimension. The gameLoopFunction
function will run commands with the Overworld as the dimension of execution.
For example, the following command says the names of all entities in all loaded dimensions because no dimension-binding parameter is used:
say All entities: @e
Once one of the parameters is included, the command will only say the names of entities in the command sender's dimension. If the command were run in a command block in the Overworld, it will only say the names of entities in the Overworld. If the command block were in the End, it will only say the names of entities in the End:
say Entities in the current dimension: @e[x=0]
Since your command is running via gameLoopFunction
and includes distance=256..
, it will be restricted to selecting endermen in the Overworld (of which none will have their Dimension
tag naturally set to 1).
In 1.12, you would work around this by using /execute
to change the command sender to one that is known to be in the desired dimension, who will then run the command you wish to affect only that dimension. For example, assuming that an entity with the tag "end" exists only in the End, the following will say the names of all entities in the End dimension even if the command block (or gameLoopFunction
) running this command is not in the End:
execute @e[tag=end] ~ ~ ~ say Entities in the End: @e[x=0]
Unfortunately for 1.13, there is currently a bug preventing the dimension of execution from changing to the relevant target in /execute
: https://bugs.mojang.com/browse/MC-122893
That bug must be fixed in order to use this method. Otherwise you will have to have physical command blocks in the End, though that does not help if they are not loaded.
Correct answer by Skylinerw on November 9, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP