Hi ArprussTried that and got the same result in Minecraft nothing happens, if I run it in a dos prompt I get the same error as before. I also moved the command out of the posttochat command and it looks like the error follows the getBlockWithData command.ThanksMelcus

ok so if I run the script using getBlockWithData in minecraft nothing happens. If I run it in a dos prompt I getC:\Users\Mel\AppData\Roaming\.minecraft\mcpimods\python>python melfindblockid.pyTraceback (most recent call last): File "melfindblockid.py", line 20, in <module> mc.postToChat(mc.getBlockWithData(pos.x,pos.y-1,pos.z)) File "C:\Users\Mel\AppData\Roaming\.minecraft\mcpimods\python\mcpi\minecraft.py", line 217, in getBlockWithData return Block(*map(int, ans.split(",")[:2]))ValueError: invalid literal for int() with base 10: "Unknown command: `world.getBlockWithData'"C:\Users\Mel\AppData\Roaming\.minecraft\mcpimods\python>This doesn't really make sense to me as there is a function in minecraft.py called 'getBlockWithData', bu...

ok so if I run the script using getBlockWithData in minecraft nothing happens. If I run it in a dos prompt I getC:\Users\Mel\AppData\Roaming\.minecraft\mcpimods\python>python melfindblockid.pyTraceback (most recent call last): File "melfindblockid.py", line 20, in <module> mc.postToChat(mc.getBlockWithData(pos.x,pos.y-1,pos.z)) File "C:\Users\Mel\AppData\Roaming\.minecraft\mcpimods\python\mcpi\minecraft.py", line 217, in getBlockWithData return Block(*map(int, ans.split(",")[:2]))ValueError: invalid literal for int() with base 10: "Unknown command: `world.getBlockWithData'"C:\Users\Mel\AppData\Roaming\.minecraft\mcpimods\python>This doesn't really make sense to me as there is a function in minecraft.py called 'getBlockWithData', but that's what it says. :(ThanksMelcus

embrassed smilely.Yes I was using getBlocksWithData instead of getBlockWithData but when I changed it, it still didn't work, so by chance I tried getBlock and that did seem to work, but when I checked the blocks in the mod (glacticcraft) it gave me the same id for a lot of the different blocks, so still not completely right.However in the meantime I have been playing around with some other stuff, and is it possible to change the direction of a block, for most blocks this does not matter, but if you are trying to place stairs the direction of the block is important and I was wondering if this was parameter that could be set?ThanksMelcus

Hi Arpruss,Thanks all this info.I tried your example script but nothing happened, so in an attempt to debug the problem I ran the script in a dos window and got the followingC:\Users\Mel\AppData\Roaming\.minecraft\mcpimods\python>python melfindblockid.pyTraceback (most recent call last): File "melfindblockid.py", line 20, in <module> mc.postToChat(mc.getBlocksWithData(pos.x,pos.y-1,pos.z)) File "C:\Users\Mel\AppData\Roaming\.minecraft\mcpimods\python\mcpi\minecraft.py", line 276, in getBlocksWithData return self.fallbackGetBlocksWithData(*args) File "C:\Users\Mel\AppData\Roaming\.minecraft\mcpimods\python\mcpi\minecraft.py", line 249, in fallbackGetBlocksWithData return self.fallbackGetCuboid(self.getBlockWithData, args) File "C:\Users\Mel\AppData\Roaming\.minecraft\mcpimods\python\mcpi\minecraft.py", line 240, in fallbackGetCuboid (x0,y0,z0,x1,y1,z1) = map(lambda x:int(math.floor(float(x))), flatten(args))ValueError: need more than 3 values to unpackSo after a bit of googling I think the problem is I am not getting the expected number of parameters back from the map command.As you can see I am using mcpimods (minecraft 1.7.10) would that be what is causing the problem? I have tried to work out what the code is doing but python has some functions I have not seen or used before, my best guess as to what this is doing ismap is taking the results of function lambda x:int(math.floor(float(x))) and mapping that to flatten(args)The function seems to be converting floating point numbers into integers, but even after looking at the code of flatten I still have no idea what it is doing. As floor is mentioned in the lambda function I would guess it is actually producing a set of co-ords for the floor, but how that is meant to equal 2 sets of co-ords (x0,y0,z0,x1,y,1,z1) I'm not sure but it does mean the error message makes sense as it is expecting 6 values and only getting 3.Anyway please forgive I am thinking out loud, your instructions are great and I have already gotten a script to build a basic house written with randomly placed windows thanks to you help.ThanksMelcus

Hi,Thanks for that. I understand now how it works and it also answered a couple of other questions like for instance why the probability was adding up to slightly more than 1.I may be pushing my luck but I have one more question. In the Block.py you have defined all the blocks that can be used. Is it possible and if so how would you go about adding blocks from other mods to this list?Thanks again.

Hi,These instructions are great thanks for putting them up, I have already started writing some basic scripts of my own.But I have a question in one of your example scripts 'castle.py' the wall of the castle is made of a number of types of blocks which from my reading of the code is generated by the followingdistribution = ((.05,MOSS_STONE), (.1,Block(STONE_BRICK.id, 1)), (.2,Block(STONE_BRICK.id, 2)), (.651,Block(STONE_BRICK.id, 0)))which brings me to my problem, I am new to python so forgive me if I am saying something silly, but this doesn't look like a normal list to me, so could you point me the direction of the definition of this data type and also some instructions on how to use it, as I wold like to be able to make use of this kind of function in my own scripts.Thanks