Minecraft-Java-Edition

有沒有辦法在箱子和/或分配器中放置帶有命令的命令塊?

  • March 3, 2022

我在新快照中,並試圖從分配器和命令塊中隨機生成 TP,就像 SethBling 在他的快照影片中一樣,不同之處在於我想將分配器放置在無限數量的命令塊而不是 64 個每個。

SethBling 的影片,相關點在 14 分鐘左右:

To get a command block item with a command datatag:

  • Place down a command block
  • Type in the command you want
  • Hold CTRL
  • Middle click the command block

You should be able to see a “+NBT” in purple below the item name when you hover over it, indicating that the item has extra data. You can then put this in dispensers, chests, etc.

The easiest way to have limitless command blocks would be to have a “template dispenser” with all of your custom command blocks in that never gets activated, and then have the activation button clone the template down onto where you want the actual dispenser. A setup like this will work:

enter image description here

In the latest version (1.8.6) you cannot place command blocks with dispensers anymore, due to an exploit which allowed malicious players to edit NBT data of a block, specifically Command Blocks and Signs.

This exploit would allow any malicious player (if he had a command block) to edit in any command before placing it with a dispenser to trigger it in survival. This command block could do anything from giving them 64 diamond blocks to blowing the entire server sky high.

引用自:https://gaming.stackexchange.com/questions/158000