In MCEdit filter programming, how do you create a chest from scratch? Aren't chests entities and handled differently than a block for which you could use setBlockAt.
Can anyone show some sample code for creating a new empty chest in a filter? Preferably inside the selection box made by the user.
After digging into the source for MCE and also source for some of SethBling's filters I managed to whip up some code.
The following functions assume a global object named levelOBJ which is set to the incoming level object in your perform() function. This way you don't have to keep passing level or box.
Then you can use my functions in your filter by calling them as described in the samples below. Below, x,y,z assumes they have been populated by proper coordinates you wish the chest to be placed at.
Also, double chests are simply two side by side chests. Call CreateChestAt twice (two coordinates 1 apart E-W or N-S) to create a double chest. You can create 3 in a row but Minecraft will invalidate the 3rd chest making it inaccessible in-game so pay attention to how you place them.
To Create an empty chest:
To Create a chest with items:
Optional parameters of Direction and CustomName can be specified too...
Creates an empty chest facing West named "My Chest"