Results 1 to 10 of 10
  1. #1

    Need help with Command Block on Vanilla Minecraft

    Here's the basic question: I am trying to use a command block (itemID 137) to act as a... 'teleportation stone' so to speak, on my single-player world.

    I know that the command block:
    must target @p
    must reference XYZ for its own coordinates (teleportation stone)
    must reference XYZ for the destination point (where the player will be teleported to)
    must define a radius from the command block (distance from the teleportation stone you need to be to get teleported)
    must utilize the /tp command

    But, simply put, I have no idea how to string these all together; could anyone familiar with the command block please help me with this? I'd prefer not to break my world with messy trial-and-error :/
    "Live life, remember, improve, but never regret."
    "Fin rot se Nehhonjul, komeyt kos vonmindoraan."


    ~1/x~

  2.    Sponsored Links


  3. #2
    Derp of #TeamRULTexas Premium Member
    BlacKnight's Avatar
    Join Date
    Sep 2012
    Country
    Users Country Flag
    Posts
    1,335

    Mine-Tastic RUL Follower Chatty Poster Extraordinaire Likes RUL

    I'm not quite sure what you want, if you want to use a Command Block to get from Point A to Point B, the command should be /tp @p <XCoord> <YCoord> <ZCoord>.
    If this isn't what you want, please elaborate a bit, as I'm confused as to your intentions.






  4. #3
    from my understanding (having read the minecraft wiki article on the command block) @p will reference the nearest player. With only a single player on the server, that would hypothetically lock said player in place by constantly teleporting them to a set location. I haven't tried this as of yet, as I currently don't have any worlds that need breaking.
    The method I see around this 'constant teleportation' problem, is by defining a radius (using arguments, which I don't fully understand through the limited description on the wiki page) around the point of the command block (or hypothetically any other variable point, it shouldn't matter if the location is a command block or not) within which a player will be teleported to another location.

    Of course, my understanding of the command block may be flawed... but based on what -I think- I know, I need to have a location-range set for the point of the teleportation's origin.

    -- I should also note, that I attempted "/tp @p[x=#, y=#, z=#, r=#] # # #" (with #'s being filled in with coordinate values) and it failed to do anything anywhere.
    Last edited by Arrowstar; March 16th, 2013 at 01:18 AM.
    "Live life, remember, improve, but never regret."
    "Fin rot se Nehhonjul, komeyt kos vonmindoraan."


    ~1/x~

  5. #4
    Derp of #TeamRULTexas Premium Member
    BlacKnight's Avatar
    Join Date
    Sep 2012
    Country
    Users Country Flag
    Posts
    1,335

    Mine-Tastic RUL Follower Chatty Poster Extraordinaire Likes RUL

    Quote Originally Posted by Arrowstar View Post
    from my understanding (having read the minecraft wiki article on the command block) @p will reference the nearest player. With only a single player on the server, that would hypothetically lock said player in place by constantly teleporting them to a set location. I haven't tried this as of yet, as I currently don't have any worlds that need breaking.
    The method I see around this 'constant teleportation' problem, is by defining a radius (using arguments, which I don't fully understand through the limited description on the wiki page) around the point of the command block (or hypothetically any other variable point, it shouldn't matter if the location is a command block or not) within which a player will be teleported to another location.

    Of course, my understanding of the command block may be flawed... but based on what -I think- I know, I need to have a location-range set for the point of the teleportation's origin.

    -- I should also note, that I attempted "/tp @p[x=#, y=#, z=#, r=#] # # #" (with #'s being filled in with coordinate values) and it failed to do anything anywhere.
    The command block does not need a teleportation origin, nor will it infinitely loop a teleport command unless you hook it up to a clock. Also, I'm still not EXACTLY sure what you mean. If you could elaborate, as I requested in the previous post, that would be most helpful.

    EDIT: P.S. If you're worried about the game looping the command if you use a lever, don't. Even if you want to use a lever (for some reason), the Command Block will only re-send a command after power is removed and re-applied to the block.
    Last edited by BlacKnight; March 16th, 2013 at 01:52 AM.






  6. #5
    I see how it is Arrow - you don't just ask me....? Is this a world save you are willing to put on a private server? If not I'll open mine up and show you exactly how to set it up
    I love command blocks - they are some of the most amazing tools in minecraft aside from the redstone itself.


    I know what you're trying to pull off


  7. #6
    Yeah I also see how it is Arrow, leaving your homies out of the loop. The command block teleport is easy to set up. No radius needed as the block checks the server when triggered. Be aware on how you activate it though. Example:

    I thought I'd be all cool and chill by using a command block to teleport someone 5k blocks straight up, over the command block. It was activated by a touch plate set to nearest player (intended to be whoever activated it). Alas, the Adeptus Suborbitus would snag the closest player, regardless of distance, when the touch plate was activated by a mob. The cool thing is when the player hit the ground (touch plate) it teleported them back up with no damage taken. So, unless you want to be this evil, I suggest using a button.

  8. #7
    lol guys. I think the main confusion here, is that I don't want the player to have to activate/press anything in order to trigger the block's teleportation sequence, The idea is that 'player' will approach the block, not seeing anything that could be considered a trap, (eg; pressure plate), but be teleported away from it before they can reach it. I'm doing this specifically for the purpose of opening up my world into a server one day, as well as for resolving technical issues that could impede another of my planned projects (a maze with teleportation zones that makes it rediculously hard to get out of)

    So, if I am to provide a 'constant' teleportation command requiring no player input, then I'm going to have to loop a redstone signal. If I don't specify a target area where 'player' must be picked up (versus being any random map location) then all 'players' will be transported over and over again to the destination point, due to @p targeting the nearest player Regardless Of Distance To The Block.

    I don't know how to specify further than this Blacknight... perhaps an example will help?

    EXAMPLE:
    command block coordinates: x: 10, y: 20, z: 30
    destination coordinates: x: 40, y: 50, z: 60
    PURPOSE: any player who walks within a 5 block radius of the command block is teleported to destination coordinates.


    And spook? I tried opening a server once; it didn't end well -_-.... If you're willing to help me set it up though, I might be able to show you the project I'm working on (you'll be able to see the secret location lol)

    edit: also, I should point out that mobs will likely be swarming around the location of the command block as well, which would result in an issue similar to BC's 5k fall, should I be forced to use pressure plates.
    Last edited by Arrowstar; March 16th, 2013 at 07:18 PM.
    "Live life, remember, improve, but never regret."
    "Fin rot se Nehhonjul, komeyt kos vonmindoraan."


    ~1/x~

  9. #8
    EXAMPLE:
    command block coordinates: x: 10, y: 20, z: 30
    destination coordinates: x: 40, y: 50, z: 60
    PURPOSE: any player who walks within a 5 block radius of the command block is teleported to destination coordinates.
    So I may have found a way to do this using specifiers. You said you didn't want to use any buttons, so I set up a redstone loop to a command block to constantly activate it. I then used a specifier to see if anyone was in the radius of the command block.

    tp @p[r=5] x y z

    The [r=5] is the specifier, which is looking for the nearest player in a radius of 5 around the command block.

    If a player is detected within 5 block radius of the command block, they will be teleported to the coords.
    Last edited by Rez; March 16th, 2013 at 08:06 PM.

  10. #9
    Actually - it's even easier using the new 1.5 command block commands (testfor) I'll run a quick series of tests using 1.4.7 and a redstone loop (which is how it's done before testfor) and it can be done targeting a specific area, away from the block - or a radius around the block - many factors.

    Rez has it with his example by the way - testfor makes things a little easier too, you just may need to run two command blocks if it still isn't allowing nesting.
    Last edited by M457ERSP00K; March 16th, 2013 at 08:53 PM.


  11. #10
    much appreciated, thank you guys
    "Live life, remember, improve, but never regret."
    "Fin rot se Nehhonjul, komeyt kos vonmindoraan."


    ~1/x~

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •