Skip to main content

Issue with location parameter when using summon command in Notebooks



  • Official comment
    Laylah Bulman

    Our new Python Library Reference Guide with all commands, six associated exercises in the new Python Playgrounds, and a new MS Learn course for Advanced Python due out at the end of the month! Debbie Alexander Pucheng Mao

  • Debbie Alexander
    Moderator Beacon of Knowledge Super Star

    Hi, Jenny Godingt !  i will take a peek right now! I'm glad to know you are continuing in Python Notebooks! =]

    Checked it to be sure: if you run this from too far a way, the distance may not allow the command.

    chickens = 100
    for count in range(chickens):
        summon("chicken", "2 0 0") 
    # This is an absolute location
    # If you are on a flat world, your chickens are
    # spawning into the void, or 
    # in the bottom layer of bedrock
    I don't want to assume this solves anything for you, though. Do your commands work without a location? Can you change the absolute location to be near your spot on the map? Does that help? Let me know! =]
  • Jenny Goding

    Hi Debbie,

    Thanks so much for that! - I'd been using world.set () earlier, which of course uses location relative to the player's position, and I'd completely forgotten that summon () uses the absolute position.

    I had a few students getting that same error last year, and could never quite work out what that error message was about - most likely, they were too far away from the spawning location.  So this time around, I'll have a much better idea of what the problem is.

    The notebooks are a great set up - the perfect combination of basic Python skills with Minecraft.  We have quite a few students who pick our Digital Technology elective because they've heard they'll get to do Minecraft, then they get into the coding side of things and are hooked!



  • Moderator Beacon of Knowledge Super Star

    Glad to help. So just to clarify, the coordinates with quotation marks, "2 0 0" are absolute, unless you use tilde, such as "~2 ~0 ~0" in which case they are relative... and (2,0,0) is also absolute, and does not allow tilde.

    (I hope I am getting that right; I am not double checking it with code at the moment. very dangerous)


  • Pucheng Mao

    hi, Debbie Alexander:

    Hello, I would like to ask, where can I find the complete python api manual? I only found this documentation:

    However, the documentation does not give a good description of the representation of similar positions. I sometimes use the makecode editor, where the pos(x,y,z) function is used for the relative position. I don't know where there is a more detailed explanation? 

    Or Notebooks and makecode editor are completely different Apis ?

    Thanks a lot.


  • Moderator Beacon of Knowledge Super Star

    I m sorry, I did not see this until recently. The only manual I know of is the documentation I have posted on my blog, here:


Please sign in to leave a comment.