Skip to main content

Python coding problem with coordinates, how do I exclude y position?

Comments

1 comment

  • Penny Support
    Bug Zapper Super Star Beacon of Knowledge Support

    Hi billy motric!

    Thanks for being the first to post in our new Coding in Minecraft forum!  I'm going to relay some info from my dev team, let me know if you still have questions.

    Use x = agent.get_position().getValue(Axis.X)

    In python on MakeCode.  You can also use the block code mode to get just the x and the z and convert to python code.  If converting isn't an option, then use the text in the first line.

    y and z are very similar. just change for which one you want

    agent_postion = world(x, 0, 0) if you need to use those values

     

    When your code gets to the line
       if x == y:


    You will need to change something about how the variable y is defined, as that's a Position whereas x is a number.

     

    0

Please sign in to leave a comment.