ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel
  • »
  • Games, Toys, and Hobbies»
  • Computer & Video Games

Proximity Messages for Adventure Maps in Minecraft

Updated on October 31, 2013
Receive a message from the Evil Overlord when you reach the end of the tunnel....
Receive a message from the Evil Overlord when you reach the end of the tunnel....

What's a Proximity Detector?

A proximity detector will trigger one or more designated commands when you get close to a certain block. My original line of thinking was to use this to deliver messages and progress the story-line in an adventure map, however I learned the same setup allows for many more cool things as well!

As I'm brand new to Minecraft, it took me nearly two hours to figure out how to utilize the various components required to set this up correctly.

What's your favorite type of adventure map?

See results

Command Block

The detector and message are triggered through command blocks, which aren't available in creative mode unless you type /give <player> 137 into the command prompt, where <player> is you.

This setup has two command blocks and a little redstone mechanism to power them.

/testfor

One block has the /testfor command to output when the closest player is within 3 blocks. Ultimately I should be able to put this mechanism anywhere on the map and use exact coordinates to "testfor" or trigger the positive output, but I'll test that out another day. For now, I have the mechanism behind the wall of my test tunnel, so being in proximity to the block works just fine.

/say

The other block uses the /say command to deliver the message. Possibly the /tell command would be better to use here, since I believe /say will broadcast to all players in the map, not just the player that triggered the message.
For now, I'm only concerned with one person at a time going through the map, so it's not that important a distinction.

Redstone Comparator

In order to conditionally transfer signal from the /testfor command block to the /say command block, a redstone comparator is needed. This acts like an if/then operator with a boolean (true/false) switch if you think of it like a program.

IF the nearest player is in a 3 block radius
THEN trigger the /say command, sending a message to the player.


You can't directly power the /testfor command block, however, because once the comparator is triggered, it will stay powered even if the conditions aren't true. Likewise, a switch, button or pressure plate won't work for this purpose because it'd be reliant upon a user to turn it on and off to activate the message, making the automation pointless.

Two command blocks joined by a comparator, powered by a small, simple redstone clock.
Two command blocks joined by a comparator, powered by a small, simple redstone clock.

Note about Redstone Clocks

The delay on the repeaters needs to be set to 2-4 ticks, otherwise it'll burn itself out due to blinking too fast.

Redstone Clock

The only choice for powering the /testfor block is a redstone clock, or infinite timer loop. This clock is ultimately a self-powered circuit depending on the redstone repeater, flipping itself on and off according to the delay that's set. This briefly removes the power from the command block, allowing the comparator to be reset to cancel the output when the conditions are no longer true.

The clock was a bitch for me to figure out, mostly because there are so many terrible tutorials out there on how to create it. Why does it seem like 98% of all Minecraft tutorials are video in nature? Doesn't anyone write anything down anymore? All I needed was a simple little picture with three or four notes on it. Ultimately the video at the bottom of this post did the best job of helping me figure out a small, simple redstone clock, which was handy as it also did the best job of helping me figure out this proximity detector.

A Message From the Evil Overlord

I came across this trick of using the anvil to rename the command block, which can make it seem like an NPC is delivering the message, as shown in the first photo of this post.

It would be truly awesome if each block could be named individually, but it appears that they're tied together by type. So, in this case, all command blocks are named Evil Overlord. Possibly useful, but limiting.

Putting it All Together

This video lays it all out, although there are a plethora of additional possibilities other than using this configuration as a proximity detector to spit out a message.

You could set the conditions to test for when a player reaches a certain level or a certain number of players meet the criteria. You could reset mobs, change the time of day, teleport, change the difficulty level, give players items, spawn mobs, play a sound, give a player an achievement, give out XP, set up trap doors, allow access to the next level or pretty much any other command or redstone-triggered item or device.

With the vast array of possibilities, I'm very excited to figure out applications and test them for use in building my own adventure map!

Comments

    0 of 8192 characters used
    Post Comment

    • profile image

      Johna402 2 years ago

      Ovver the course of the initial period, they began tto form grooup fdccecageakd

    • profile image

      Paula Koehn 3 years ago

      I am recceiving numerous emails from strangers commenting on

      Proximity and I would like to never receive these again.

      Please help me m,,,,,,,, Paula Koehn

    working

    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: "https://hubpages.com/privacy-policy#gdpr"

    Show Details
    Necessary
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
    Features
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Marketing
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Statistics
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)