# 保存した構造物を削除する(blocks.deleteStructure) > 保存しておいた構造物を、名前を指定して削除するブロックです。 - カテゴリ:ブロック(blocks) - ブロック:"my structure" という名前の構造物を削除する - URL:https://makecode.minecraft-okinawa.com/reference/blocks/delete-structure/ - Pythonでの名前:blocks.delete_structure - 公式データ取得日:2026-11-13 - 動作確認:確認待ち ## JavaScript ```javascript blocks.deleteStructure("my structure") ``` ## Python ```python blocks.delete_structure("my structure") ``` ## 引数 | 名前 | 値 | 意味 | |---|---|---| | name | 文字列 | | ## 使用例 ### Make a chat command to build a fenced corral that surrounds the player. Fill the corral with some horses. Save the horse corral as a structure so you can load it somewhere in the world later. Also, make a chat command to remove the corral from memory. ```javascript player.onChat("makecorral", function () { blocks.fill( SPRUCE_FENCE, pos(-20, 0, -20), pos(20, 0, 20), FillOperation.Outline ) for (let index = 0; index < 10; index++) { mobs.spawn(HORSE, randpos( pos(-19, 0, -19), pos(19, 0, 19) )) } blocks.saveStructure( "horse corral", pos(-20, 0, -20), pos(20, 0, 20) ) }) player.onChat("removecorral", function () { blocks.deleteStructure("horse corral") }) ``` ```python def on_on_chat(): blocks.fill(SPRUCE_FENCE, pos(-20, 0, -20), pos(20, 0, 20), FillOperation.OUTLINE) for index in range(10): mobs.spawn(HORSE, randpos(pos(-19, 0, -19), pos(19, 0, 19))) blocks.save_structure("horse corral", pos(-20, 0, -20), pos(20, 0, 20)) player.on_chat("makecorral", on_on_chat) def on_on_chat2(): blocks.delete_structure("horse corral") player.on_chat("removecorral", on_on_chat2) ``` ## 出典 - [MakeCode for Minecraft 公式リファレンス(blocks.deleteStructure)](https://minecraft.makecode.com/reference/blocks/delete-structure) 執筆:鈴木孝昌(現役プロジェクトマネージャー/マイクラカップ指導者)/運営:沖縄マイクラ部 プログラミングスクール「クロスウェーブ」(https://minecraft-okinawa.com/)