gdpc.editor_tools¶
Provides various Minecraft-related utilities that require an Editor.
- centerBuildAreaOnPlayer(editor: Editor, size: Vec3iLike) Box¶
Sets
editor’s build area to a box ofsizecentered on the player, and returns it.The build area is always in global coordinates;
editor.transformis ignored.
-
flood_search_3D(editor: Editor, origin: Vec3iLike, boundingBox: Box, search_block_ids: Iterable[str], diagonal: bool =
False, depth: int =256) set[ivec3]¶ Return a list of coordinates with blocks that fulfill the search.
Activating caching (
Editor.caching) is highly recommended.
-
placeSign(editor: Editor, position: Vec3iLike, wood: str =
'oak', wall: bool =False, facing: str ='north', rotation: str | int ='0', frontLine1: str ='', frontLine2: str ='', frontLine3: str ='', frontLine4: str ='', frontColor: str ='', frontIsGlowing: bool =False, backLine1: str ='', backLine2: str ='', backLine3: str ='', backLine4: str ='', backColor: str ='', backIsGlowing: bool =False, isWaxed: bool =False) None¶ Places a sign with the specified properties.
If
wallis True,facingis used. Otherwise,rotationis used.See also:
minecraft_tools.signData(),minecraft_tools.signBlock().
-
placeLectern(editor: Editor, position: Vec3iLike, facing: str =
'north', bookData: str | None =None, page: int =0) None¶ Place a lectern with the specified properties.
bookDatashould be an SNBT string defining a book. You can useminecraft_tools.bookData()to create such a string.See also:
minecraft_tools.lecternData(),minecraft_tools.lecternBlock().
-
placeContainerBlock(editor: Editor, position: Vec3iLike, block: Block =
Block('minecraft:chest'), items: Iterable[tuple[Vec2iLike, str] | tuple[Vec2iLike, str, int]] | None =None, replace: bool =True) None¶ Place a container block with the specified items in the world.
itemsshould be a sequence of (position, item, [amount,])-tuples.
-
setContainerItem(editor: Editor, position: Vec3iLike, itemPosition: Vec2iLike, item: str, amount: int =
1) None¶ Sets the item at
itemPositionin the container block atpositionto the item with iditem.
- getOptimalFacingDirection(editor: Editor, pos: Vec3iLike) list[str]¶
Deprecated
Deprecated along with
lookup. See the warning at the top of the lookup page for the reasons and for alternatives.Returns the least obstructed directions to have something facing (a “facing” block state value).
Ranks directions by obtrusiveness first, and by obtrusiveness of the opposite direction second.