I have the following code (in Java Version ) that is designed to print out a warning message when the player (who doesn't have a team listed) enters the radius of 70 blocks of the command block. I have attempted instead to cast the field around an armor stand nearby, but neither methods work. It is on a server (that I run and host, commandblocks have been enabled). In order to run the function, I just do function funcs:temple/playerdef. Have a look at the code below.

execute at @s[type=minecraft:armor_stand, tag=here] run execute as @a[tag=!mortal, team=!AthenaKnights, team=!NyxNova, distance=..70] run tellraw @s {"text":"You have entered holy land without permission! May curses come down upon you!", "color":"dark_red"}
execute as @a[team=!AthenaKnights, team=!NyxNova, distance=..70] run tag @s add mortal
execute at @s[tag=mortal, distance=..70] run function funcs:fx/flamepillar
effect give @s[tag=mortal, distance=..70] minecraft:blindness 5 5 true
effect give @s[tag=mortal, distance=..70] minecraft:levitation 5 140 true
execute as @a[tag=mortal, distance=71..] run tellraw @s {"text":"Your curses have been lifted for exiting the holy land.", "color":"green"}

The idea is, when they leave the radius, the effects and tag should get removed. But for some reason it is not executing at all when I execute it through a repeat commandblock.

  • Note that the funcs:fx/flamepillar function works perfectly, as I have tested that separately. – JerryPlayz101 Aug 10 at 3:30
  • Can you reduce it to the minimum example, please? You have quite a lot of things there that are probably not essential for this problem and debugging all of this is way more work than finding the problem in a smaller example. – Fabian Röling Aug 10 at 9:54
  • @FabianRöling - I dont know where the error is, because it loads into Minecraft (so therefore no syntax errors) and doesn't provide a runtime error like it would if for example it could not find a player. Im expecting it to be a logical error, but I cannot deduce where. To be clear, the function is designed to tell the player that they have crossed a point in the world (within 70 blocks of the command block) then append a tag to them (to prevent them from getting it spammed to them) then get debuff effects added to them (and particles) and then when they leave, remove the tag and tell them. – JerryPlayz101 Aug 10 at 14:14
  • So, what does happen? Does the player stays cursed when they leave the holy land? Does the "you have left" message gets spammed? Does the curse not trigger at all? Something else? – pppery Aug 10 at 16:22
  • So, the curse is applied when they enter, the enter message is done once. THen the effects are applied continuously until they leave the zone. Then when they leave the zone the "you have left" message is printed once and all effects are removed. Thats the simplest way I can put it I think. – JerryPlayz101 Aug 11 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.