快轉到主要內容

Add-On query.block_neighbor_has_any_tag用法

分類   遊戲攻略 Minecraft
標籤   Minecraft Add-On
🗓️ 民國110年 辛丑年
✍ 切換正體/簡體字

Minecraft基岩版 1.17.30.21實裝了query.block_neighbor_has_any_tag這個函數,可查詢相鄰方塊的tag。

用法:

query.block_neighbor_has_any_tag (x, y, z , tag名)

利用這個函數,可偵測附近方塊的狀態,控制該方塊的外觀。

來看Ihategravel的例子,他做出了自動連結的柱子。

這裡下載他的範本包

All the blocks update automatically btw. pic.twitter.com/x6pmjasDgy

— Ihategravel (@ihategravel2) August 13, 2021

自訂柵欄方塊也變的可能。

Made working custom fences using the new molang queries in 1.17.30.21! I’ll be releasing this on @MCPEDL soon.
(you can jump over them but mobs can’t)

Massive thanks to @ihategravel2 for his pillar template that got me started with the new add-on features :) pic.twitter.com/zbAXtXSNfc

— HonKit26113 (@HonKit1103) August 13, 2021

甚至還能自訂傀儡。

The new codes from the blocks can be used from more thing that make connected textures, also you can make custom golems like in this example.
This add-on will be soon in @MCPEDL pic.twitter.com/1xGv7Yd9X9

— Xero (@UrielXero) August 14, 2021

Ihategravel的做法是寫好方塊狀態的property。

用tick組件隨時執行更新方塊狀態的event,使用query.block_neighbor_has_any_tag偵測上下左右放置的方塊,再交由permutation決定方塊的geometry。

Property用法參見:

實體 & 方塊 Properties的用法

相關文章

Minecraft Add-On 實體 Properties的用法
分類   遊戲攻略 Minecraft
標籤   Minecraft Add-On
Minecraft基岩版Aternos伺服器安裝資源包/Add-on
分類   遊戲攻略 Minecraft
標籤   Minecraft Server Minecraft Add-On
【自製模組】不要盯著Minecraft的太陽,否則會瞎掉 Don't Stare At the Sun
分類   遊戲攻略 Minecraft
標籤   Minecraft Add-On Minecraft Behavior Pack

留言板

此處提供二種留言板。點選按鈕,選擇您覺得方便的留言板。要討論程式碼請用Giscus,匿名討論請用Disqus。

這是Giscus留言板,需要Github帳號才能留言。支援markdown語法,若要上傳圖片請貼Imgur或Postimages。您的留言會在Github Discussions向所有人公開。

這是Disqus留言板,您可能會看到Disqus強制投放的廣告。有時留言可能會被系統判定需審核,導致延遲顯示,請見諒。若要上傳圖片請貼Imgur或Postimages。