3

I was looking for a way to check if a player is exposed (no roof or anything) for a project and ended up thinking of one, but I failed to create it.

I found out that spreadplayer will tp the armorstand to the highest block on the xz cords and used Pos[1](y cord) with store to store the Y value.Then, i'd subtract the armorstand score to mine, so if it's +, then it's above, and bellow is -.Then, to prevente lag, it would take sometime to refresh and repeat the process.
But I found bug and can't find a way to fix it. The problem I stumbled upon was that if the armorstand is bellow,it would get a - score value and die as expected, but after 3 times of killing itself, it would emit a positive signal (even though the score displayed as always -) and trigger as if it were above me.

World download: World Download
A little messed up but here is the chart: Print

Since I'm looking foward to use it in Multiplayer, creating a unique armorstand to each player simultaneosly is pretty hard. I found out that spreadplayer will tp the armorstand to the highest block on the xz cords and used Pos[1](y cord) with store to store the Y value.Then, i'd subtract the armorstand score to mine, so if it's +, then it's above, and bellow is -.Then, to prevente lag, it would take sometime to refresh and repeat the process.

  • 4
    You could set fire at the player's location and check if the rain extinguishes it. But something tells me that that's not a good idea. ;) – Fabian Röling Sep 1 '19 at 8:49
  • Something is messed up with that archive, I can't get some of the files out of it. Here's the 7z output: pastebin.com/GbwGFNmH Maybe try packing it as zip without compression, that always works flawlessly for me on all devices. Or simply upload the folder to Google Drive, that automatically takes care of everything else. – Fabian Röling Sep 1 '19 at 9:36
  • I'm not sure on how to ping others, but here it is: drive.google.com/open?id=1IEa3OaexgHavF24jE8jrxNbeJwqvtIAj – Bruno Rodrigues Sep 2 '19 at 0:08
  • You ping other users like this: @FabianRöling -- however I don't think a ping is necessary when only one user has commented on your question, as they are automatically notified. – pppery Sep 2 '19 at 1:06
  • Good to know since I was concerned you wouldn't get notificated. – Bruno Rodrigues Sep 2 '19 at 1:17
1

When you want to detect this on a multiplayer server, I would create a plugin, whichs checks, if it's raining (by getting the weather of the world of the player) and if the weather is actually affecting the biome at the players location (e.g. there is no rain in the desert). If this all is given and the block below the player is also the highest block at the players location, then the player is 'affected' of the rain.

| improve this answer | |
  • I'm more focoused in command block, as I usually play by myself. It's more about the challenge in doing it so rather then the result. I'll take a look into some plugins, but I've never used any. Also, would you be able to transfer these info (raining and exposed) to a command block? – Bruno Rodrigues Sep 3 '19 at 16:50
  • Oh okay, didn't got this - sorry. No, I'm not thaaat familiar with command blocks to transfer this logic to command blocks. – Marvin Klar Sep 4 '19 at 6:54
0

The simpliest solution:

/execute as [selector] at @s if blocks ~ ~1 ~ ~ 255 ~ x y z all run scoreboard players set @s [name] 1
/execute as @p at @s if blocks ~ ~1 ~ ~ 255 ~ 25 31 10 all run scoreboard players set @s [name] 0

Where [name] stands for the scoreboard name of your choice, [selector] is the player or entity you are looking to test for and x y z is a coordinate of the world where it should be all air(only the block of that coordinate and all above). 1 means he is exposed and 0 means he is in cover.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.