Skip to main content

Block orientation when placed by agent



  • Ernie Support

    Hey Brad,

    Unfortunately, at this time there is no way to change the orientation of logs placed with the agent

  • Garima Singh
    Novice (Bronze) Rising star (Silver)

    In Minecraft, placing logs sideways can be achieved using commands in either JavaScript or Python. Here's an example using commands in both languages:

    JavaScript (in-game command block):

    /setblock ~ ~ ~ minecraft:oak_log[axis=x]

    This command places an oak log with its axis set to the x-direction, which makes it appear sideways.

    Python (using the Minecraft API):

    from minecraft import * mc = Minecraft.create() # Coordinates where you want to place the log x, y, z = 0, 0, 0 # Place oak log sideways mc.setBlock(x, y, z, BLOCK_WOOD, 0, 0b00000100)

    In the Python example, BLOCK_WOOD is the block ID for oak logs, and 0b00000100 sets the log's orientation to the x-direction.

    Make sure to replace the coordinates (x, y, z) with the desired location in both examples.

    If you're using command blocks in-game, you might need to enable cheats in your world and use the /give command to obtain command blocks. Then, you can input the command in the command block.

    Remember to backup your world before making significant changes, especially when experimenting with commands.

  • Debbie Alexander
    Moderator Beacon of Knowledge Super Star

    Wonderful! I wish I had data like this for Python AZNB. 

  • Brad Gerards

    Thanks Garima. 

    I was hoping to be able to do it using the agent, so students could watch it happen, but I may have to resort to command blocks, or just not worry about it and let the logs all face the wrong way. That's what I'm doing right now.


Please sign in to leave a comment.