0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Minecraftのgamerule allowmobs falseを使うな

0
Posted at

はまってしまって、時間が溶けたので自分用メモ。

はじめに

Minecraft Education Editionで遊んでいた時のこと。10人のプレイヤーを10個の部屋に、一人ずつランダムにtpする機能をコマンドブロックで書いていた。方針としては、透明armor_standを召喚(/summon)し、@r[tag!=selected,type=player]みたいな感じでtpして、最寄りのプレイヤーにタグをつける。最後にarmor_standを隣の部屋にtpさせる、みたいな感じで設計した。
けれど、armor_standがなぜか召喚されず、コマンドブロック群が動作しなかった。

試したこと

クリエイティブでアーマースタンドを設置するとコマンドブロック群が正常に動作した。またチャット欄から/summon armor_stand XX YY ZZを実行すると正常にアーマースタンドが召喚され、もちろんコマンドブロック群も動作した。

コマンドブロックの前回の実行結果を確認したところ「対象の召喚に成功しました」と表示されていた。(画像は分かりやすいように~ ~2 ~に設定)
スクリーンショット 2026-11-13 213020.png

以下のようにコマンドブロックを置くと、チェーンコマンドブロックのtestforは成功する
 インパルス:/summon armor_stand XX YY ZZ
  ↓
 チェーン:/testfor @e[type=armor_stand]

解決策

/gamerule allowmobs trueを実行すると、正常に動作した。

意味が分からない仕様

/gamerule allowmobs falseの時の仕様として、

  • 基本的にアーマースタンドを含むモブはスポーンしなくなる
  • ただし、チャットのコマンドからは召喚可能
  • コマンドブロックの「前回の実行結果」には召喚が成功したと表示される
  • チェーンしているコマンドブロック群では召喚されていることになる(testfor等が成功する)

推測だが、/gamerule allowmobs falseは召喚自体を停止するのではなく、/killを毎tick(?)実行する、みたいな対処療法的な仕様になっているのではないだろうか。だからこそ、召喚直後は/testfor等が成功するのではないだろうか。

おわりに

単にモブの召喚を抑えたい場合は、/gamerule domobspawning falseを使おう。/gamerule allowmobs falseを使う場面は、かなり限定的かも。(Education Editionしかないコマンドであることも踏まえると、子どものいたずら防止とか?どんなを想定しているんだろう。)

image.png

 

ほんとに、何なのこの仕様??

 

参考文献

https://edusupport.minecraft.net/hc/en-us/community/posts/15729409430804-Mobs-not-spawning-but-NPC-spawn-works

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?