Testing for structures near players

Testing for structures near players - Photo of Men Playing Basketball

I want to have a redstone timer that has a signal into a command block, with /execute @a ~ ~ ~ testforblocks <Coordinate 1> <Coordinate 2> <Relative Position> and then a compartor, testing if a structure 1 X away from the player (I may make it 2) is the same as a structure I built somewhere else. (A chest with a sign on top of it reading “[Case]” and then having 2 iron blocks next to the chest) Then, the chest will fill with random loot, and the iron and sign disappear. I know how to do the random loot, and how to make the blocks disappear, but using /execute will only test if A player is next to the structure. How do I tell the players that are near the structure from the players that aren't?



Best Answer

Note: this Answer is based off the assumption that you are making that structure using a command or making it yourself. Sorry if this is not correct.

A) Marking the structure:

First, whenever that structure is spawned, summon an armorstand in one of those blocks with the NBT tags Invisible, CustomName and Marker. (Ex. /summon ArmorStand x y z {Marker:1b, Invisible:1b, CustomName:bob})

B) marking the player as near the structure:

Make a dummy scoreboard (example name:nearS) Now add this command to a 20 t/s clock: execute @a ~ ~ ~ execute @e[type=ArmorStand,name=bob,r=1] ~ ~ ~ scoreboard players set @p nearS 1 and this command also on that clock: scoreboard players set @a nearS 0 (making 20 tick/s clock) Then, you can distinguish which players are near it and which are not by their number on the scoreboard nearS.




Pictures about "Testing for structures near players"

Testing for structures near players - Small village located near rocky mountains with waterfall
Testing for structures near players - People Playing Soccer on Green Field
Testing for structures near players - Gray Concrete Building on Top of Hill



How do you perform a structural test?

Structural Testing Techniques:
  • Statement Coverage - This technique is aimed at exercising all programming statements with minimal tests.
  • Branch Coverage - This technique is running a series of tests to ensure that all branches are tested at least once.


  • What is NDT mention any 5 NDT methods?

    Radiography NDT (RT) Eddy Current NDT (ET) Magnetic Particle NDT (MT) Acoustic Emission NDT (AE)

    When to do NDT testing?

    During construction, NDT is used to ensure the quality of materials and joining processes during the fabrication and erection phases, and in-service NDT inspections are used to ensure that the products in use continue to have the integrity necessary to ensure their usefulness and the safety of the public.

    How many types of structure testing are there?

    There are 4 types of Structural Testing: Control Flow Testing: Control flow testing is a type of structural testing that uses the programs's control flow as a model. The entire code, design and structure of the software have to be known for this type of testing.



    Non-Destructive Testing for Structural Evaluation and Condition Assessment




    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Yaroslav Shuraev, Gotta Be Worth It, David Gan, Suliman Sallehi