1

Need help with testfor command!

Moldomre's Avatar Moldomre6/6/17 3:08 pm
1 emeralds 224 3
6/6/2017 6:07 pm
guestds's Avatar guestds
I'm working on a custom map where a title appears to a player that enters that specific region. I'm using a pressure plate at the moment, but the enemies that the player has to fight keep walking on it! If they do that, then it'll show what's ahead to the player! And nobody likes spoilers! I'm wondering if the /testfor command could somehow work so that it tests if a player's within three blocks of the command source, and if there is a player near, it activates the title. Does anyone know if this is possible with plugins or mods?
Posted by Moldomre's Avatar
Moldomre
Level 62 : High Grandmaster Pixel Painter
113

Create an account or sign in to comment.

3

1
06/06/2017 6:07 pm
Level 19 : Journeyman Modder
guestds
guestds's Avatar
Click to reveal
and maybe to only do this for players with a specific tag and change the tag for anyone inside the area (slightly smaller for tag changer?) to something else (like set the tag for players to 0 then change to 1 and so on or invert between these)

above is so when you stand inside the area itll only effect a player once until the tag changes again

using some ways the command blocks work with parts of Saibur's post:
put the cmd block on impulse with "testfor @p[r=2]"
have it face down into one on chain with "title @a[r=3] title {"text":"HOI","color":"red"}"
have the chain with conditional and impulse with unconditional
if you put this under the second pressure plate (if you allow backtracking, if not have 2 doors and have it under the second doors plate k)

not sure if you can change the color to #000000 text but... type a color and if minecraft has it then it should work

change text to what you want k, btw this is without the tag value so itll show all players within range every time pressed

place the blocks like this:
roof
block
air
pressureplate
floor
impulse
chain

and it should detect anyone within a 3.25x3.25 area (aka about an extra 1/8 streach off of a 3x3 area) and centered around the plate

hopefully this helps though i suggest using Saibur's thing if you want to have all command blocks in one spot and have the initial impulse be chain with conditional and another impulse detecting the pressureplate (or copy the plate above the observer if you have it and it doesnt spam updates unless the plate changes)


spoilered cause i typed and dont stop typing alot lol
1
06/06/2017 4:28 pm
Level 22 : Expert Zombie
Saibur
Saibur's Avatar
Place one command block that is set to repeat and always active with the command testfor @p[x=coordinate,y=coordinate,z=coordinate,r=radius] then place a comparator next to the command block and place another one down and set it to impulse and requires redstone, then put the command title @p title {"text":"YOUR TITLE HERE","color":"YOUR COLOUR HERE"}
1
06/06/2017 4:14 pm
Level 4 : Apprentice Miner
birdy117
birdy117's Avatar
Can you send a screenshot of the level please?
I would really like to see what specifically is the problem

If anything try changing the layout of the area. Try making an area where the player only has access to it and the other monsters can't reach it.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome