“ |
|
„ | |
— Jeb о командном блоке[1] |
Эта статья — о командном блоке. О том, как использовать команды, см. Команды консоли.
Командный блок (англ. Command Block) — это блок, который способен выполнять команды. Этот блок нельзя получить без использования читов, поэтому в основном он используется на серверах для создания особых механизмов.
Получение
Раньше чтобы выдать себе командный блок, нужно было использовать команду /give @s command_block
(@a-все игроки,
@p-ближайший игрок,
@s-вы) или /give Ваш_ник command_block
. Но в снапшоте 22w44a была добавлена возможность взять командный блок из меню творческого режима, с 1.19.3 появляется в творческом инвентаре только с включенной опцией «Вкладка оператора» в меню «Управление». Чтобы сразу поставить командный блок, можно использовать команду /setblock координаты command_block
или /fill начало конец command_block
.
Как и другие блоки, этот блок хранит NBT данные; СКМ+Ctrl будет копировать командный блок вместе с командой и другими параметрами.
Командные блоки недоступны в инвентаре Творчества и не могут быть сломаны в Выживании. Командный блок не горит и не может быть сдвинут поршнем.
Использование
Командный блок может выполнять команды консоли, записанные в него, когда активирован редстоун-сигналом. С версии 1.9 может работать без сигнала (если установлена настройка «Всегда включён» или «Always active»). Он всегда имеет высший уровень доступа, а значит, может исполнять все доступные в игре команды, кроме большинства серверных (/stop
, /ban
, /kick
и т. д.), а также /debug
, /publish
и /reload
.
Добавлять и изменять код в командном блоке можно через его интерфейс (открывается использованием кнопки «Использовать предмет» на командном блоке). Игрок может открыть интерфейс только находясь в режиме Творчества. Для использования командного блока на сервере, в файле server.properties должны быть установлены следующие значения:
enable-command-block
должно иметь значениеtrue
op-permission-level
должно иметь значение2
и более (по умолчанию 4)
На сервере его могут открывать только игроки со статусом оператора.
Интерфейс командного блока
-
Интерфейс командного блока
-
Интерфейс командного блока с выполненной командой
Командная строка
Команды вводятся в верхнюю строку интерфейса. Максимальное количество символов, умещающихся в одном командном блоке — 32 500, но строка может показывать только первые несколько десятков. Прокручивать текст можно с помощью кнопок ← и →, если зажать Ctrl при прокрутке, она значительно ускорится. Автоподстановка команд производится кнопкой Tab ↹ (пример: /to
+ Tab ↹ → /toggledownfall
).
Подстановка символа /
перед вводом команды необязательна, он не влияет на выполнение команды.
Под командной строкой находятся подсказки по выбору целей для команд консоли.
Строка вывода
В нижней строке интерфейса выводится последний результат выполнения команды данным командным блоком при успешном выполнении, или отчёт об ошибке при невозможности выполнения. Изначально эта строка пуста. Текст в ней не редактируется игроком.
Кнопка справа от строки вывода определяет, должен ли отчёт быть сохранён и отображён (O
когда включено сохранение и отображение отчёта, и X
в обратном случае), по умолчанию — O
. Командный блок, отображающий отчёт и беспрерывно исполняющий команду, будет постоянно обновляться. Если 64 командных блока будут обновляться в одном и том же чанке, произойдёт обновление этого чанка и, возможно, некоторых соседних, что может значительно понизить количество кадров в секунду (FPS) для игроков, поэтому рекомендуется отключать вывод отчёта при возможности.
Импульсный/Цепной/Цикличный
Нажав на кнопку «Impulse/Chain/Repeat», командный блок сменит свой тип.
- Impulse Цвет текстуры: оранжевый. Выполняет команду лишь единожды при активации.
- Chain Цвет текстуры: аквамарин (голубовато-зелёный). Активируется только если включён, и при этом активировался первый блок цепочки (цепочка составляется из одного командного блока типа «Импульсный» или «Цикличный» и неограниченного количества блоков типа «Цепной», направленных друг на друга по цепочке). Выполняет команду когда до него доходит очередь (если предыдущие командные блоки цепочки уже попытались выполнить свои команды). Если блок, состоящий в цепочке, оказывается выключен, цепочка не прерывается и следующим свою команду пытается выполнить следующий не выключенный блок цепочки.
- Repeat Цвет текстуры: фиолетовый. Выполняет команду каждый игровой такт (двадцать раз в секунду) пока включён.
Условный/Безусловный
При нажатии на кнопку «Conditional/Unconditional» меняется поведение блока.
- Conditional или «Условный» командный блок будет пытаться выполнить команду только в случае, если последняя попытка выполнить свою команду стоящего «сзади» командного блока была успешной.
- Unconditional или «Безусловный» командный блок будет выполнять команду при стандартных условиях выполнения команды для командных блоков своего типа.
По умолчанию — «Unconditional»
Нужен Редстоун-сигнал/Всегда включён
Нажав кнопку «Always active/Needs Redstone», можно переключать зависимость командного блока от сигнала красного камня.
- Needs Redstone: командный блок в этом режиме не будет выполнять команд, пока не получит сигнал красного камня.
- Always active: командный блок в этом режиме не будет требовать сигнала красного камня (будет постоянно включённым).
По умолчанию у импульсного и цикличного — Needs Redstone, у цепного — Always active.
Принять/Отменить
При нажатии на кнопку «Done» в интерфейсе командного блока или кнопку «принять» (↵ Enter) клавиатуры, тот закрывается и сохраняет все внесённые в него изменения.
При нажатии на кнопку «Cancel» в интерфейсе командного блока или кнопку «отменить» (Esc) клавиатуры, тот закрывается, не сохраняя внесённые в него изменения.
Сбор информации из командного блока
Есть несколько способов собрать данные с командного блока после его попытки выполнить команду:
Компаратор
Если поставить компаратор лицевой стороной от командного блока, он будет выдавать сигнал с силой, соответствующей успешности выполнения команды (0/1 — «не удалось выполнить»/«выполнено успешно» соответственно или 0-15 — найдено соответствующее количество сущностей/блоков, удовлетворяющих команде. Если таких более 15, выдаётся максимальный (сила 15) сигнал).
Компаратор выдаёт сигнал, соответствующий результату крайнего выполнения команды, даже если после этого командный блок был выключен.
Сообщение
Выводимые командным блоком сообщения уведомляют об успешном выполнении команды или о невозможности её выполнения. Отчёты командных блоков появляются в следующих местах:
- Строка вывода
- Протокол крайнего выполнения команды находится в строке вывода, которую можно увидеть, открыв интерфейс самого командного блока, если вывод не был отключён (см. строка вывода).
- Чат
- Сообщение о результате выполнения команды командным блоком присылаются в чат игроку в одиночной игре и операторам сервера в сетевой, если ранее не была прописана команда
/gamerule commandBlockOutput false
. Некоторые команды направлены на написание текста в чат (/me
,/say
и/tell
). На такой текст вышеуказанная команда не действует. - Журнал сервера
- Сообщение о результате выполнения команды командным блоком записываются в журнал (лог) сервера, если не была прописана команда
/gamerule logAdminCommands false
.
Статистика командного блока
Командные блоки могут записывать различные результаты успешного выполнения команд в списки задач, такие как:
- SuccessCount: количество успешных выполнений (по аналогии с компаратором см. cбор информации из командного блока, но не ограничено значением 15).
- AffectedBlocks: количество блоков, на которые подействовала команда.
- AffectedEntities: количество сущностей, на которые подействовала команда.
- AffectedItems: количество предметов, на которые подействовала команда.
- QueryResult: значение, возвращённое командой.
Цели, которые необходимо отслеживать, можно указать, выполнив команду /stats
или непосредственно изменив данные NBT-тега командного блока с помощью команды /blockdata
.
Руководство
Указатель на сущность может иметь привязку к конкретному типу сущности. Задаётся эта привязка аргументом
type
— Как пример, команда/kill @e[type=Skeleton]
убьёт всех скелетов, а команда/kill @e[type=!Player]
убьёт все сущности, не являющиеся игроком.
Также если командный блок переименовать на наковальне и ввести в него команду /say
, то при активации в чат выведется вписанное сообщение. Но перед сообщением вместо символа @ появится имя, которое было дано командному блоку.
Также были замечены особенности, в расположении командных блоков и порядком исполнения команд, при подключении нескольких блоков к одному источнику питания:
-
Расположение командных блоков относительно источника питания
-
Вывод командных блоков
Вот расположение командных блоков относительно сторон света:
-
Юг
-
Запад
-
Север
-
Восток
Значения
ID блока
Java Edition
Название | Идентификатор | Теги предмета (JE) | Форма | Ключ перевода |
---|---|---|---|---|
Командный блок | command_block |
dragon_immune wither_immune |
Блок и предмет | block.minecraft.command_block
|
Цепной командный блок | chain_command_block |
dragon_immune wither_immune |
Блок и предмет | block.minecraft.chain_command_block
|
Цикличный командный блок | repeating_command_block |
dragon_immune wither_immune |
Блок и предмет | block.minecraft.repeating_command_block
|
Название | Идентификатор |
---|---|
Блок-сущность | command_block
|
Bedrock Edition
Название | Идентификатор | Числовой ID | Форма | Ключ перевода |
---|---|---|---|---|
Командный блок | command_block |
137 |
Блок и предмет | tile.command_block.name
|
Цепной командный блок | chain_command_block |
189 |
Блок и предмет | tile.chain_command_block.name
|
Цикличный командный блок | repeating_command_block |
188 |
Блок и предмет | tile.repeating_command_block.name
|
Название | Идентификатор |
---|---|
Блок-сущность | CommandBlock
|
Нумерация данных
Байты | Значения |
---|---|
0x1 | Устанавливается, если командный блок был активирован ранее. |
0x2 0x4 0x8 |
(Не используется) |
Состояния блока
Название | Значение | Описание |
---|---|---|
conditional | true false |
true , если командный блок находится в условном режиме. |
facing | north south east west up down |
Направление, куда указывает командный блок. |
Галерея
-
Первый скриншот[2]
-
Второй скриншот[3], демонстрирующий выполнение команды
-
Опция conditional меняет текстуру стрелки командного блока
-
Командные блоки в вагонетках
История
Официальный выпуск Java Edition | ||
---|---|---|
27 июля 2012 | Джеб в своём твиттере опубликовал информацию о блоке, предназначенном для режима Приключения. Он начал размещать идеи, фотографии и намеки на те функции, которые блок будет выполнять. | |
Во время AMA Нотч намекнул, что блок будет добавлен в 1.4. | ||
1.4 | 12w32a | Командный блок был добавлен в игру. |
12w38a | Был добавлен расширенный синтаксис указания цели. | |
1.7.2 | 13w37a | Появилась возможность ставить блоки с помощью команды setblock. |
13w39a | Была добавлена вагонетка с командным блоком. | |
Возможна ошибка с тем, что командный блок не увидит компаратор. | ||
1.8 | 14w07a | Раздатчики могут устанавливать командные блоки. |
1.9 | 15w34a | Была переработана текстура командного блока. Теперь командный блок можно настроить на выполнение трёх функций: Impulse (активирует командный блок), Chain (активирует командные блоки по цепочке) и Repeat (повторяет заданную команду несколько раз в секунду, не останавливаясь). Командные блоки также имеют направление, как и поршни. |
15w34b | Добавлены две новые функции: Условная и Безусловная. При функции «Условная» командный блок выполнит команду только если команда предыдущего блока была успешно выполнена. | |
15w35a | Снова обновлены текстуры командного блока. Добавлены новые опции для командного блока: Всегда активен и/или Нуждается в настройках красного камня. | |
1.12 | 17w16a | Улучшена производительность у цепного командного блока. |
17w18a | Проведена оптимизация ошибочных условий в командных блоках. | |
1.12-pre6 | Авто-завершение команды с помощью Tab ↹ в командных блоках больше не добавляет / перед командой. |
|
1.13 | 18w21a | Изменён цвет всплывающей подсказки у командного блока и его разновидностей. |
1.13-pre1 | Исправлена ошибка, которая гласит, что «Завершение табуляции команд в командных блоках не работает». | |
1.14 | 18w47b | Изменены текстуры командного блока и цикличного командного блока. |
Официальный выпуск Pocket Edition | ||
1.0.5 | build 1 | Командный блок добавлен в игру. |
Официальный выпуск Bedrock Edition | ||
1.8 | beta 1.8.0.8 | Командный блок теперь имеет имя по умолчанию «!» вместо «@». |
1.12 | beta 1.12.0.2 | Добавлено авто-завершение команды с помощью Tab ↹ в командных блоках. |
Добавлена опция «Задержка» для командного блока, реализующая задержку между выполнениями команд в количестве тактов красного камня, указанном в значении данного поля. |
Проблемы
Отчёты об ошибках, связанных с «Командный блок», поддерживаются в системе отслеживания ошибок Mojira. Сообщайте о найденных ошибках там (на английском языке).
Интересные факты
- Если в мультиплеере во время передвижения на вагонетке зайти в командный блок, то минув несколько блоков, вы автоматически выйдете из его интерфейса.
Примечания
- ↑ https://twitter.com/jeb_/status/228829830731427840
- ↑ https://twitter.com/jeb_/status/228829830731427840
- ↑ https://twitter.com/jeb_/status/228848952240373761
“ |
|
„ | |
— Jeb о командном блоке[1] |
Эта статья — о командном блоке. О том, как использовать команды, см. Команды консоли.
Командный блок (англ. Command Block) — это блок, который способен выполнять команды. Этот блок нельзя получить без использования читов, поэтому в основном он используется на серверах для создания особых механизмов.
Получение[]
Раньше чтобы выдать себе командный блок, нужно было использовать команду /give @s command_block
(@a-все игроки,
@p-ближайший игрок,
@s-вы) или /give Ваш_ник command_block
. Но в снапшоте 22w44a была добавлена возможность взять командный блок из меню творческого режима, с 1.19.3 появляется в творческом инвентаре только с включенной опцией «Вкладка оператора» в меню «Управление». Чтобы сразу поставить командный блок, можно использовать команду /setblock координаты command_block
или /fill начало конец command_block
.
Как и другие блоки, этот блок хранит NBT данные; СКМ+Ctrl будет копировать командный блок вместе с командой и другими параметрами.
Командные блоки недоступны в инвентаре Творчества и не могут быть сломаны в Выживании. Командный блок не горит и не может быть сдвинут поршнем.
Использование[]
Командный блок может выполнять команды консоли, записанные в него, когда активирован редстоун-сигналом. С версии 1.9 может работать без сигнала (если установлена настройка «Всегда включён» или «Always active»). Он всегда имеет высший уровень доступа, а значит, может исполнять все доступные в игре команды, кроме большинства серверных (/stop
, /ban
, /kick
и т. д.), а также /debug
, /publish
и /reload
.
Добавлять и изменять код в командном блоке можно через его интерфейс (открывается использованием кнопки «Использовать предмет» на командном блоке). Игрок может открыть интерфейс только находясь в режиме Творчества. Для использования командного блока на сервере, в файле server.properties должны быть установлены следующие значения:
enable-command-block
должно иметь значениеtrue
op-permission-level
должно иметь значение2
и более (по умолчанию 4)
На сервере его могут открывать только игроки со статусом оператора.
Интерфейс командного блока[]
-
Интерфейс командного блока
-
Интерфейс командного блока с выполненной командой
Командная строка[]
Команды вводятся в верхнюю строку интерфейса. Максимальное количество символов, умещающихся в одном командном блоке — 32 500, но строка может показывать только первые несколько десятков. Прокручивать текст можно с помощью кнопок ← и →, если зажать Ctrl при прокрутке, она значительно ускорится. Автоподстановка команд производится кнопкой Tab ↹ (пример: /to
+ Tab ↹ → /toggledownfall
).
Подстановка символа /
перед вводом команды необязательна, он не влияет на выполнение команды.
Под командной строкой находятся подсказки по выбору целей для команд консоли.
Строка вывода[]
В нижней строке интерфейса выводится последний результат выполнения команды данным командным блоком при успешном выполнении, или отчёт об ошибке при невозможности выполнения. Изначально эта строка пуста. Текст в ней не редактируется игроком.
Кнопка справа от строки вывода определяет, должен ли отчёт быть сохранён и отображён (O
когда включено сохранение и отображение отчёта, и X
в обратном случае), по умолчанию — O
. Командный блок, отображающий отчёт и беспрерывно исполняющий команду, будет постоянно обновляться. Если 64 командных блока будут обновляться в одном и том же чанке, произойдёт обновление этого чанка и, возможно, некоторых соседних, что может значительно понизить количество кадров в секунду (FPS) для игроков, поэтому рекомендуется отключать вывод отчёта при возможности.
Импульсный/Цепной/Цикличный[]
Нажав на кнопку «Impulse/Chain/Repeat», командный блок сменит свой тип.
- Impulse Цвет текстуры: оранжевый. Выполняет команду лишь единожды при активации.
- Chain Цвет текстуры: аквамарин (голубовато-зелёный). Активируется только если включён, и при этом активировался первый блок цепочки (цепочка составляется из одного командного блока типа «Импульсный» или «Цикличный» и неограниченного количества блоков типа «Цепной», направленных друг на друга по цепочке). Выполняет команду когда до него доходит очередь (если предыдущие командные блоки цепочки уже попытались выполнить свои команды). Если блок, состоящий в цепочке, оказывается выключен, цепочка не прерывается и следующим свою команду пытается выполнить следующий не выключенный блок цепочки.
- Repeat Цвет текстуры: фиолетовый. Выполняет команду каждый игровой такт (двадцать раз в секунду) пока включён.
Условный/Безусловный[]
При нажатии на кнопку «Conditional/Unconditional» меняется поведение блока.
- Conditional или «Условный» командный блок будет пытаться выполнить команду только в случае, если последняя попытка выполнить свою команду стоящего «сзади» командного блока была успешной.
- Unconditional или «Безусловный» командный блок будет выполнять команду при стандартных условиях выполнения команды для командных блоков своего типа.
По умолчанию — «Unconditional»
Нужен Редстоун-сигнал/Всегда включён[]
Нажав кнопку «Always active/Needs Redstone», можно переключать зависимость командного блока от сигнала красного камня.
- Needs Redstone: командный блок в этом режиме не будет выполнять команд, пока не получит сигнал красного камня.
- Always active: командный блок в этом режиме не будет требовать сигнала красного камня (будет постоянно включённым).
По умолчанию у импульсного и цикличного — Needs Redstone, у цепного — Always active.
Принять/Отменить[]
При нажатии на кнопку «Done» в интерфейсе командного блока или кнопку «принять» (↵ Enter) клавиатуры, тот закрывается и сохраняет все внесённые в него изменения.
При нажатии на кнопку «Cancel» в интерфейсе командного блока или кнопку «отменить» (Esc) клавиатуры, тот закрывается, не сохраняя внесённые в него изменения.
Сбор информации из командного блока[]
Есть несколько способов собрать данные с командного блока после его попытки выполнить команду:
Компаратор[]
Если поставить компаратор лицевой стороной от командного блока, он будет выдавать сигнал с силой, соответствующей успешности выполнения команды (0/1 — «не удалось выполнить»/«выполнено успешно» соответственно или 0-15 — найдено соответствующее количество сущностей/блоков, удовлетворяющих команде. Если таких более 15, выдаётся максимальный (сила 15) сигнал).
Компаратор выдаёт сигнал, соответствующий результату крайнего выполнения команды, даже если после этого командный блок был выключен.
Сообщение[]
Выводимые командным блоком сообщения уведомляют об успешном выполнении команды или о невозможности её выполнения. Отчёты командных блоков появляются в следующих местах:
- Строка вывода
- Протокол крайнего выполнения команды находится в строке вывода, которую можно увидеть, открыв интерфейс самого командного блока, если вывод не был отключён (см. строка вывода).
- Чат
- Сообщение о результате выполнения команды командным блоком присылаются в чат игроку в одиночной игре и операторам сервера в сетевой, если ранее не была прописана команда
/gamerule commandBlockOutput false
. Некоторые команды направлены на написание текста в чат (/me
,/say
и/tell
). На такой текст вышеуказанная команда не действует. - Журнал сервера
- Сообщение о результате выполнения команды командным блоком записываются в журнал (лог) сервера, если не была прописана команда
/gamerule logAdminCommands false
.
Статистика командного блока[]
Командные блоки могут записывать различные результаты успешного выполнения команд в списки задач, такие как:
- SuccessCount: количество успешных выполнений (по аналогии с компаратором см. cбор информации из командного блока, но не ограничено значением 15).
- AffectedBlocks: количество блоков, на которые подействовала команда.
- AffectedEntities: количество сущностей, на которые подействовала команда.
- AffectedItems: количество предметов, на которые подействовала команда.
- QueryResult: значение, возвращённое командой.
Цели, которые необходимо отслеживать, можно указать, выполнив команду /stats
или непосредственно изменив данные NBT-тега командного блока с помощью команды /blockdata
.
Руководство[]
Указатель на сущность может иметь привязку к конкретному типу сущности. Задаётся эта привязка аргументом
type
— Как пример, команда/kill @e[type=Skeleton]
убьёт всех скелетов, а команда/kill @e[type=!Player]
убьёт все сущности, не являющиеся игроком.
Также если командный блок переименовать на наковальне и ввести в него команду /say
, то при активации в чат выведется вписанное сообщение. Но перед сообщением вместо символа @ появится имя, которое было дано командному блоку.
Также были замечены особенности, в расположении командных блоков и порядком исполнения команд, при подключении нескольких блоков к одному источнику питания:
-
Расположение командных блоков относительно источника питания
-
Вывод командных блоков
Вот расположение командных блоков относительно сторон света:
-
Юг
-
Запад
-
Север
-
Восток
Значения[]
ID блока[]
Java Edition
Название | Идентификатор | Теги предмета (JE) | Форма | Ключ перевода |
---|---|---|---|---|
Командный блок | command_block |
dragon_immune wither_immune |
Блок и предмет | block.minecraft.command_block
|
Цепной командный блок | chain_command_block |
dragon_immune wither_immune |
Блок и предмет | block.minecraft.chain_command_block
|
Цикличный командный блок | repeating_command_block |
dragon_immune wither_immune |
Блок и предмет | block.minecraft.repeating_command_block
|
Название | Идентификатор |
---|---|
Блок-сущность | command_block
|
Bedrock Edition
Название | Идентификатор | Числовой ID | Форма | Ключ перевода |
---|---|---|---|---|
Командный блок | command_block |
137 |
Блок и предмет | tile.command_block.name
|
Цепной командный блок | chain_command_block |
189 |
Блок и предмет | tile.chain_command_block.name
|
Цикличный командный блок | repeating_command_block |
188 |
Блок и предмет | tile.repeating_command_block.name
|
Название | Идентификатор |
---|---|
Блок-сущность | CommandBlock
|
Нумерация данных[]
Байты | Значения |
---|---|
0x1 | Устанавливается, если командный блок был активирован ранее. |
0x2 0x4 0x8 |
(Не используется) |
Состояния блока[]
Название | Значение | Описание |
---|---|---|
conditional | true false |
true , если командный блок находится в условном режиме. |
facing | north south east west up down |
Направление, куда указывает командный блок. |
Галерея[]
-
Первый скриншот[2]
-
Второй скриншот[3], демонстрирующий выполнение команды
-
Опция conditional меняет текстуру стрелки командного блока
-
Командные блоки в вагонетках
История[]
Официальный выпуск Java Edition | ||
---|---|---|
27 июля 2012 | Джеб в своём твиттере опубликовал информацию о блоке, предназначенном для режима Приключения. Он начал размещать идеи, фотографии и намеки на те функции, которые блок будет выполнять. | |
Во время AMA Нотч намекнул, что блок будет добавлен в 1.4. | ||
1.4 | 12w32a | Командный блок был добавлен в игру. |
12w38a | Был добавлен расширенный синтаксис указания цели. | |
1.7.2 | 13w37a | Появилась возможность ставить блоки с помощью команды setblock. |
13w39a | Была добавлена вагонетка с командным блоком. | |
Возможна ошибка с тем, что командный блок не увидит компаратор. | ||
1.8 | 14w07a | Раздатчики могут устанавливать командные блоки. |
1.9 | 15w34a | Была переработана текстура командного блока. Теперь командный блок можно настроить на выполнение трёх функций: Impulse (активирует командный блок), Chain (активирует командные блоки по цепочке) и Repeat (повторяет заданную команду несколько раз в секунду, не останавливаясь). Командные блоки также имеют направление, как и поршни. |
15w34b | Добавлены две новые функции: Условная и Безусловная. При функции «Условная» командный блок выполнит команду только если команда предыдущего блока была успешно выполнена. | |
15w35a | Снова обновлены текстуры командного блока. Добавлены новые опции для командного блока: Всегда активен и/или Нуждается в настройках красного камня. | |
1.12 | 17w16a | Улучшена производительность у цепного командного блока. |
17w18a | Проведена оптимизация ошибочных условий в командных блоках. | |
1.12-pre6 | Авто-завершение команды с помощью Tab ↹ в командных блоках больше не добавляет / перед командой. |
|
1.13 | 18w21a | Изменён цвет всплывающей подсказки у командного блока и его разновидностей. |
1.13-pre1 | Исправлена ошибка, которая гласит, что «Завершение табуляции команд в командных блоках не работает». | |
1.14 | 18w47b | Изменены текстуры командного блока и цикличного командного блока. |
Официальный выпуск Pocket Edition | ||
1.0.5 | build 1 | Командный блок добавлен в игру. |
Официальный выпуск Bedrock Edition | ||
1.8 | beta 1.8.0.8 | Командный блок теперь имеет имя по умолчанию «!» вместо «@». |
1.12 | beta 1.12.0.2 | Добавлено авто-завершение команды с помощью Tab ↹ в командных блоках. |
Добавлена опция «Задержка» для командного блока, реализующая задержку между выполнениями команд в количестве тактов красного камня, указанном в значении данного поля. |
Проблемы[]
Отчёты об ошибках, связанных с «Командный блок», поддерживаются в системе отслеживания ошибок Mojira. Сообщайте о найденных ошибках там (на английском языке).
Интересные факты[]
- Если в мультиплеере во время передвижения на вагонетке зайти в командный блок, то минув несколько блоков, вы автоматически выйдете из его интерфейса.
Примечания[]
- ↑ https://twitter.com/jeb_/status/228829830731427840
- ↑ https://twitter.com/jeb_/status/228829830731427840
- ↑ https://twitter.com/jeb_/status/228848952240373761
16 августа 2016
Гайды
Сегодня расскажем о том, что такое командный блок в Майнкрафт, как его получить, зачем он нужен и как, где и для чего его можно использовать.
- Что такое командный блок;
- Где и для чего они используются;
- Как их использовать;
- Практические примеры использования командных блоков.
Что такое командные блоки?
В игре Minecraft командный блок (КБ) может автоматически выполнять определённые консольные команды до тех пор, пока активирован красным камнем.
Они работают в режиме приключения, и позволяют создателям карт улучшать взаимодействие с игроком. При этом игрок не способен разрушать блоки и строить новые.
В режиме «Выживание» с командными блоками нельзя взаимодействовать или уничтожать их.
Их нельзя создать с помощью крафтинга, и их не найти в инвентаре играя в творческом режиме. Игроки творческого режима и администраторы серверов могут использовать консольную команду «give», чтобы получить КБ или сделать его доступным для других игроков. Выглядит это так:
/give <имя_игрока> minecraft:command_block <количество блоков>
При наборе команды уберите скобки < и > по краям имени игрока и количества:
/give atombox minecraft:command_block 1
КБ имеет графический интерфейс с текстовым полем, доступный по правому клику мышки.
Размещать командные блоки, вводить команды и сохранять изменения могут только игроки в творческом режиме и игроки со статусом администратора на сервере.
Для их использования в одиночной игре или многопользовательских мирах необходимо включить режим LAN и разрешить читы.
Где используются командные блоки
Вы когда-нибудь играли на приключенческих картах, где всегда ночь, или где погода никогда не меняется? Вы могли скачивать карты, где игроки получают специальные награды, улучшения или опыт по нажатию кнопки или за завершение задания. Всё это становится возможным благодаря КБ. При создании своей карты Minecraft вам нужны командные блоки, если:
- Вы хотите постоянные день или ночь;
- Вы хотите поменять погоду;
- Вы хотите поменять сложность игры;
- Вы хотите воспроизводить определённый звук;
- Вы хотите отправить игроку сообщение;
- Вы хотите телепортироваться в другую локацию;
- Вы хотите дать игрокам предметы.
На YouTube есть множество видеороликов, описывающих разнообразные карты Minecraft. Особенно популярны многопользовательские карты. Есть много категорий доступных для скачивания карт Майнкрафт, которые используют командные блоки для повышения удобства игрока. Существует немало причин для их использования разработчиками карт. Среди них представлены карты следующих категорий:
- Приключенческие карты;
- Паркур-карты;
- Карты-головоломки;
- Карты на выживание;
Приключенческие карты заточены на сюжет, а геймер выступает в роли главного героя повествования. Ранее приключенческие карты полагались на рассказ истории посредством знаков и книг, а теперь повествование доступно посредством диалогов и звуков, и всё благодаря КБ.
Паркур-карты вынуждают игрока добираться из одного конца мира в другой с минимальным количеством смертей. Часто они содержат невероятные прыжки и прочие смертоносные препятствия. Командные блоки делают возможным устанавливать точки спауна (появления) персонажа перед сложными преградами.
Карты-головоломки делают акцент на навыки решения проблем, предлагая лабиринты, ловушки и прочие сложности. Некоторые подобные карты обладают сюжетом, как и приключенческие. Использование КБ позволяет таким картам легче предлагать направления, связанные с сюжетом диалоги и звуки.
Карты на выживание могут быть сосредоточены на выживании в одиночной игре или в многопользовательской, или же попутно включать в себя сюжет. КБ могут дать игрокам стартовую точку спауна, а также связанную с сюжетом информацию. Возможности здесь безграничны.
Как использовать командный блок
Их установка проще, чем думает большинство игроков в Minecraft. Команды могут быть запутанными, но некоторые из них (вроде установки времени дня) очень просты для программирования. Большие проекты можно планировать позже, а для начала постарайтесь овладеть основами размещения, настройки и использования КБ.
1. Переключение в творческий игровой режим
Не забывайте, что командные блоки могут появляться только в творческом игровом режиме. Для перехода в него нужны соответствующие привилегии на сервере (если доступны) или активированные читы.
В поле чата наберите «/gamemode c», «/gamemode creative» или «/gamemode 1» без кавычек.
2. Нажатие на командный блок правой кнопкой мыши
В творческом режиме для доступа к командному блоку нажмите на него правой клавишей мыши. Для его генерации нужно использовать команду «give», как описано выше в тексте:
/give <имя_игрока> minecraft:command_block <количество блоков>
Командные блоки работают, только будучи подключенными к электрической цепи красного камня (кстати, существует хороший мод Wireless Redstone, позволяющий увеличить расстояние передачи энергии). Нажатие правой кнопкой мыши открывает диалоговое окно, куда можно вводить серверную команду. Максимальная длина команды может составлять 254 символа.
3. Введите команду и нажмите «Готово»
Когда вы вводите команду в блок, нужно указать, на какого игрока она направлена. Это можно сделать вводом имени игрока или выбором трёх разных переменных: «@p» (ближайший игрок), «@r» (случайный игрок) или «@a» (все игроки). Эти переменные особенно полезны в ситуациях, когда неизвестен игрок, активирующий команду. Задав команду, нажмите «Готово» для её сохранения.
Помните, что один КБ может выполнять только одну команду!
Практические примеры использования
Следующие примеры представляют собой простые и практичные приложения командного блока в одиночной и многопользовательской игре в мирах Minecraft.
Как поменять правила игры
Игровые правила представляют собой относительно новую функцию, которая позволяет игрокам и командным блокам менять определённые базовые настройки мира Minecraft. Есть девять описанных игровых правил, которые можно контролировать при помощи командного блока на карте.
Можно использовать игровые правила для создания постоянного дневного света или темноты, отключать спаун мобов, выпадение предметов из мобов и многое другое. При вводе команды «gamerule» используйте следующую команду:
/gamerule <игровое_правило> <true/false>
Игровое правило | Эффект от правила |
commandBlockOutput | Включает/отключает ввод текста в КБ |
doDaylightCycle | Включает/отключает цикл дня/ночи |
doFireTrick | Включает/отключает распространение/исчезновение огня |
doMobLoot | Включает/отключает выпадение предметов из мобов |
doMobSpawning | Включает/отключает спаунинг мобов |
doTileDrops | Включает/отключает выпадение предметов из КБ при их разрушении |
keepInventory | Включает/отключает сохранение предметов в инвентаре после гибели игрока |
mobGriefing | Включает/отключает уничтожение КБ криперами или странником края |
naturalRegeneration | Включает/отключает регенерацию здоровья у игроков |
Как установить погоду
У некоторых карт используется тёмная тема, которая идеально сочетается с дождливой погодой или громом, тогда как в другие лучше играть с ясным небом. Есть много вариантов управлять погодой при помощи командных блоков. Простой пример команды погоды:
/weather input
В этом случае слово input можно заменить на «clear» (ясно), «rain» (дождь) или «thunder» (гром).
Можно подключить к командному блоку кнопку или рычаг для переключения погоды вручную, или создать автоматическую схему красного камня для постоянного переключения погоды. Это легко достигается использованием повторителей, кнопки и строительного блока.
Как установить точку спауна
Точки спауна являются важным компонентом многих карт Minecraft, включая приключенческие, паркур-карты, головоломки и прочие. Необходимость каждый раз при гибели перепроходить карту с самого начала чрезвычайно раздражает. Используя команду «spawnpoint», можно сохранить игровой прогресс и возродиться после гибели у ближайшего пройденного чекпоинта. Команда выглядит так:
/spawnpoint
Подключив командный блок к строительному кнопкой или прижимной пластиной, игроки могут установить точку спауна в месте нахождения КБ.
Если нужно что-то посложнее, можно добавить в команду координаты для задания места появления точки спауна.
Как телепортироваться в локацию
Бегать из одного места в другое утомляет, особенно на многопользовательском сервере. С применением команды «teleport» игроки могут перемещаться по определённым координатам мира Minecraft или в локации других игроков. Введите в командный блок:
/tp <имя_игрока> <x> <y> <z>
С ними можно иметь определённый набор координат для телепортации игрока, вроде локации следующей части приключенческой карты.
Если блок не предназначен для конкретного игрока, можно использовать «@p» для выбора ближайшего игрока.
Если вы на многопользовательском сервере, можно привязать командный блок к себе, применив своё имя пользователя в Minecraft.
Это лишь несколько вариантов как использовать командные блоки в однопользовательских и многопользовательских играх Майнкрафт. Есть много значительно более сложных команд и схем из красного камня, которые применяют создатели карт.
Загрузить PDF
Загрузить PDF
Из этой статьи вы узнаете, как в Minecarft создать командный блок (блок, который выполняет определенные команды). Это можно сделать в компьютерной и мобильной версиях игры. Чтобы создать действующий командный блок, нужно перейти в творческий режим и включить поддержку чит-кодов. Командный блок нельзя создать в консольной версии Minecraft.
-
1
Запустите Minecraft. Для этого дважды щелкните по значку этой игры. Затем нажмите «Play», «Играть», «Вход» или аналогичную кнопку (если будет предложено).
-
2
Щелкните по Одиночная игра. Эта кнопка находится в верхней части главного окна Minecraft.
- Также можно выбрать «Сетевая игра», но в этом случае сначала нужно настроить многопользовательскую игру на своем собственном сервере.
-
3
Нажмите Создать новый мир. Вы найдете эту опцию в нижней правой части окна.
- Если вы уже создали мир в творческом режиме и активировали в нем поддержку чит-кодов, щелкните по этому миру, а затем нажмите «Играть в выбранном мире» и перейдите к шагу «Нажмите /».
-
4
Введите название мира. Сделайте это в строке «Название мира».
-
5
Дважды щелкните по Режим игры Выживание. В строке сначала отобразится «Режим игры: Хардкор», а затем — «Режим игры: Творческий». Сделайте так, потому что пользоваться командными блоками можно только в творческом режиме.
- Командные блоки можно встретить и в режиме выживания, но ими нельзя пользоваться.
-
6
Нажмите Настройка мира. Эта опция находится в нижней части окна.
-
7
Щелкните по Использование читов Выкл. В строке отобразится «Использование читов: Вкл», то есть теперь поддержка чит-кодов включена.
- Если в строке отображается «Использование читов: Вкл», поддержка чит-кодов уже активирована.
-
8
Нажмите Создать новый мир. Эта кнопка находится в нижнем левом углу окна.
-
9
Нажмите /. Символ «/» можно найти на клавиатуре. В нижней части окна Minecraft откроется консоль.
-
10
Введите give player command_block в консоли. Вместо «player» введите имя своего персонажа.
- Например, если имя персонажа «potatoSkin», введите give potatoSkin command_block.
-
11
Нажмите ↵ Enter. Команда будет выполнена, а в руке персонажа появится командный блок.
-
12
Поставьте командный блок на землю. Щелкните правой кнопкой мыши по земле, когда персонаж держит командный блок.
-
13
Щелкните правой кнопкой мыши по командному блоку. Откроется окно командного блока.
-
14
Введите команду. Введите команду, которую выполнит командный блок, в строке в верхней части окна.
-
15
Измените параметры командного блока. Для этого измените следующие параметры:
- «Импульсный»: блок выполнит команду один раз, когда вы щелкните по нему правой кнопкой мыши. Нажмите «Импульсный», чтобы переключиться на «Цепной», чтобы блок запускался только тогда, когда запустится предыдущий блок. Нажмите «Цепной», чтобы переключиться на «Цикличный», чтобы блок выполнял команду 20 раз в секунду.
- «Безусловный»: дополнительный условий для работы блока нет. Нажмите «Безусловный», чтобы переключиться на «Условный», чтобы блок запускался только после того, как предыдущий блок выполнит команду.
- «Нужен сигнал»: блок будет запускаться только при контакте с Красным камнем. Нажмите «Нужен сигнал», чтобы перейти к «Всегда активен», чтобы блок запускался вне зависимости от Красного камня.
-
16
Щелкните по Готово. Теперь вы настроили командный блок.
- Если вы выбрали опцию «Нужен сигнал», подведите к командному блоку красную пыль, чтобы запустить командный блок.
Реклама
-
1
Запустите приложение Minecraft PE. Нажмите на значок в виде блока земли с травой.
-
2
Коснитесь Играть. Эта кнопка находится посередине экрана.
-
3
Нажмите Создать новый. Эта опция находится в верхней части экрана.
- Если вы уже создали мир в творческом режиме и активировали в нем поддержку чит-кодов, щелкните по этому миру, а затем перейдите к шагу «Введите команду».
-
4
Коснитесь Создать игровой мир. Эта кнопка расположена в верхней части экрана.
-
5
Введите название мира. Коснитесь поля «Название мира» и введите название мира.
-
6
В меню «Режим игры по умолчанию» выберите «Творческий». По умолчанию в этом меню выбран режим «Выживание».
-
7
Нажмите Продолжить, когда появится запрос. Теперь в новом мире можно играть в творческом режиме и пользоваться чит-кодами.
-
8
Коснитесь Создать. Эта кнопка находится в левой части страницы. Будет создан новый мир.
-
9
Щелкните по значку «Чат». Этот значок в виде речевого облака расположен в верхней части экрана (слева от значка Пауза).
-
10
Введите команду для получения командного блока. Введите /give player command_block. Вместо «player» введите имя своего персонажа.
-
11
Нажмите на направленную вправо стрелку. Она находится в правой части консоли. Команда будет выполнена, а командный блок появится в инвентаре персонажа.
-
12
Возьмите командный блок. Нажмите «⋯» в нижней правой части экрана, коснитесь вкладки со значком в виде ящика в левой части, а затем коснитесь значка командного блока.
-
13
Поставьте командный блок на землю. Для этого коснитесь земли.
-
14
Нажмите на командный блок. Откроется окно командного блока.
-
15
Измените параметры командного блока. Измените следующие параметры в левой части экрана (если хотите):
- «Тип блока»: оставьте «Импульс», чтобы блок выполнил команду, когда вы коснетесь его. Нажмите «Импульс» и выберите «Цепь», чтобы блок запускался только тогда, когда запустится предыдущий блок. Нажмите «Импульс» и выберите «Цикл», чтобы блок выполнял команду 20 раз в секунду.
- «Условие»: оставьте «Без условий», чтобы блок работал независимо от других блоков. Нажмите «Без условий» и выберите «При условии», чтобы блок запускался только после того, как предыдущий блок выполнит команду.
- «Красный камень»: оставьте «Необходим красный камень», чтобы блок запускался только при контакте с Красным камнем. Нажмите «Необходим красный камень» и выберите «Работает всегда», чтобы блок запускался вне зависимости от Красного камня.
-
16
Введите команду. Нажмите «+» в верхней правой части окна, введите команду и нажмите «-» в верхнем правом углу экрана.
-
17
Закройте окно командного блока. Нажмите «x» в правом верхнем углу экрана. Теперь вы настроили командный блок.
- Если вы выбрали опцию «Необходим красный камень», подведите к командному блоку красную пыль, чтобы запустить командный блок.
Реклама
Советы
- Параметры командного блока можно изменить в любой момент.
Реклама
Предупреждения
- Командный блок нельзя получить в консольной версии Minecraft.
Реклама
Об этой статье
Эту страницу просматривали 758 705 раз.
Была ли эта статья полезной?
Download Article
Download Article
Commands (also known as cheats) allow players to change every aspect of a Minecraft world, or even other players in it. Each command block is an in-game item that stores a specific command. Whenever the block activates, that command takes effect. This allows you to build fun toys, convenient tools, or even complex, custom adventure maps full of triggered events.
-
1
Open Minecraft on a PC or Mac. Only the computer edition of Minecraft has command blocks. They are not yet available for Minecraft Pocket Edition or Minecraft for gaming consoles.
-
2
Enter a world where you have console access. Command blocks are in-game items that give access to the Minecraft console. They are powerful tools that let you reshape the whole game — but because of this, they are only available in certain circumstances:
- On a multiplayer server, only the server operators can use command blocks. You’ll need to ask an operator to promote you, or host your own server.
- In a single-player world, you’ll need to enable cheats if they weren’t enabled at world creation. Open the menu and click Open to LAN, check the «Allow Cheats» box, and click Start LAN world. This will only last one play session, but you can repeat it each time you want to add more command blocks.
Advertisement
-
3
Switch to creative mode. Now that you have console access, you can switch to creative mode. This is the only mode that lets you place and program command blocks. Use the following command to accomplish this:
- Hit T to open the console (the chat bar), or press / to open it and automatically enter / to the line you are typing.
- Type /gamemode c and hit Enter to enter creative mode.
- Once you’re done setting up command blocks, type /gamemode s for survival mode or /gamemode a for adventure mode.
-
4
Create command blocks. Open the console again with T and type this command: /give (yourusername) minecraft:command_block 64 . Instead of (yourusername), type in your full Minecraft username, without parentheses.
- Your username is case sensitive.
- If nothing happens, you may need to update minecraft to at least version 1.4. Update to the latest version to get access to all commands.
- You can replace the «64» with any number to receive that many blocks. 64 makes a full stack of command blocks.
Advertisement
-
1
Place a command block. Check your inventory and look for the command blocks you just created. The icon is a brown, patterned box with grey control panels on each side. Move the command blocks to your quick slot and place one on the ground, just as you would any item.
-
2
Open the command block interface. Walk up to the command block and right-click to open it, as you would a chest. A window should pop up with a text box.
- If nothing happens, command blocks might be disabled on your multiplayer server. Someone with access to the server.properties file will need to open that file and set enable-command-block to «true» and op-permission-level to «2» or higher.
-
3
Enter a command. You can enter just about any command in the command block’s text field, then press Done to save it in the block. There’s a long list of commands included below, but try summon Sheep for your first experiment.
- To learn more commands, open the regular console (not the command block) and type /help.
- Unlike the regular console, a command block’s text box does not need to start with the / symbol.
-
4
Activate the block with redstone. Connect a trail of redstone dust to the command block, and place a pressure plate on top of the redstone. Walk over the pressure plate to activate the redstone, and a sheep should appear next to the block. This will happen whenever any player or mob activates the redstone.
- This works just like a regular redstone activation. You can replace the pressure plate with a button, lever, or other activation method of your choice. You can even place the button directly on the command block.
- Anyone can use the command block once it’s set up, but only players with the right permissions can change the command.
-
5
Learn the special syntax. For the most part, command block text works the same as the regular console. If you aren’t familiar with the console yet, check out the example section below to get started. If you already know how to use console commands, these are the only extra terms you need to learn:
- @p targets the player nearest to the command block, no matter how far away she is.
- @r targets a random player, anywhere on the server.
- @a targets every single player on the server, including yourself.
- @e targets every «entity» on the server. This includes practically anything that isn’t a block, including players, objects, enemies, and animals. Be careful messing with this one.
- You can use these terms wherever you would use a player name or entity name (although these terms still work fine).
-
6
Modify the syntax for more control (optional). You can create extra-specific commands by adding modifiers after @p, @r, @a, or @e. These use the at [(argument)=(value)]. There are many different arguments and values available. You can look up the full list online, but here are some examples to get you started:
- A command that includes @r[type=Sheep] will affect a random sheep.
- @e[m=c] affects everyone in creative mode. The «m» argument stands for mode, and «c» stands for creative.
- Use the ! symbol to make the opposite value. For example, @a[team=!Commando] will affect every player not on team Commando. (Teams only exist on special player-made maps.)
-
7
Use the Tab key for help. If you know a command, but aren’t sure what you can use it for, press Tab and the game will fill it out for you. Press Tab a second time to scroll through a list of options.
- For example, go back to your sheep-summoning block and delete the word «Sheep.» Press Tab to cycle through a list of possible entities to summon.
Advertisement
-
1
Make a teleportation box. Save the command tp @p x y z into a command block. Instead of x, y, and z, enter the x-, y-, and z-coordinates of the location you’d like to teleport (for example, /tp @p 0 64 0). When anyone activates this box, the player nearest to the box will vanish and reappear at those coordinates.
- Press F3 to display coordinates.
- Just like any command, you can replace the «@p» with another term. If you type your username, you’ll always be the one teleported, even if someone else activates the block. If you use @r, a random player on the server will be teleported.
-
2
Spawn objects or blocks. Assuming you’re using Minecraft 1.7 or later, you can make command blocks to summon any entity or block. Here are some examples:
- A command block with summon Boat stored will add a new boat next to the block every time the block becomes activated. The people of your server will never need to wait for a ferry again.
- To spawn a block instead of an entity, use the setblock command instead of the summon command. setblock minecraft:water 50 70 100 turns the block at the coordinates 50-70-100 into water. If there was already a block there, it disappears.
-
3
Destroy objects or players. The kill command will permanently destroy an entity. This one is dangerous to use, since a typo could end up destroying the wrong thing (or even your entire world if you use @e). kill @r[type=Painting,r=50] destroys a random painting within a 50 block radius of the command block.
-
4
Control time and weather. time set day or time set 0 will set the level of sunlight to the specified amount. Try different values instead of 0 to make it any time you like. Once you’re tired of ruling over perpetual sunshine, make a block with toggle downfall or weather rain to start the rain.
-
5
Try out even more commands. There are hundreds of commands, which you can find by using /help or searching Minecraft websites. Here are a few more to explore:
- say (message)
- give (player) (item) (number of that item)
- effect (player) (potion effect)
- gamerule
- testforblock
Advertisement
Add New Question
-
Question
What do I do if the command summoned a zombie, but didn’t put armor on it?
You need to specify if the zombie has armor:
(/summon Zombie) will tell minecraft to summon a regular zombie with nothing extra, like weapons or armor. To summon a zombie with armor, do :
/summon Zombie ~ ~ ~ {Equipment:[{id:minecraft:leather_boots},{id:minecraft:leather_leggings},{id:minecraft:leather_chestplate} {id:minecraft:leather_helmet}]}. -
Question
How do I spawn animals?
Enter summon, and then press tab to select what to summon. You can summon anything from every single mob to a lightning bolt.
-
Question
How do I destroy blocks with command blocks?
The «setblock» command places blocks, including air»blocks», so «setblock minecraft:air [x] [y] [z]» (without the quotes) should remove a block, or actually replace by air.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
-
In the regular console, type /help for a list of commands. Type /help (command name) to learn about a specific command. You can also find more information at Minecraft wikis and community websites.
-
To turn off the chat notifications for a successful command, open the regular console and enter /gamerule commandBlockOutput false.
-
Nothing happens when the signal to a command block turns off. The command block will trigger again once the signal returns.
Show More Tips
Thanks for submitting a tip for review!
Advertisement
-
A redstone signal must be boosted by a redstone repeater if it travels more than 15 blocks.
-
You must click Done to save a command block. Closing the window by pressing Esc will not save your command.
Advertisement
About This Article
Article SummaryX
1. Enter a world in which you have console access.
2. Switch to creative mode.
3. Type «/give (yourusername) minecraft:command_block (number of blocks)» at the console.
4. Place and open a command block.
5. Run a command and click Done.
Did this summary help you?
Thanks to all authors for creating a page that has been read 187,804 times.
Did this article help you?
Download Article
Download Article
Commands (also known as cheats) allow players to change every aspect of a Minecraft world, or even other players in it. Each command block is an in-game item that stores a specific command. Whenever the block activates, that command takes effect. This allows you to build fun toys, convenient tools, or even complex, custom adventure maps full of triggered events.
-
1
Open Minecraft on a PC or Mac. Only the computer edition of Minecraft has command blocks. They are not yet available for Minecraft Pocket Edition or Minecraft for gaming consoles.
-
2
Enter a world where you have console access. Command blocks are in-game items that give access to the Minecraft console. They are powerful tools that let you reshape the whole game — but because of this, they are only available in certain circumstances:
- On a multiplayer server, only the server operators can use command blocks. You’ll need to ask an operator to promote you, or host your own server.
- In a single-player world, you’ll need to enable cheats if they weren’t enabled at world creation. Open the menu and click Open to LAN, check the «Allow Cheats» box, and click Start LAN world. This will only last one play session, but you can repeat it each time you want to add more command blocks.
Advertisement
-
3
Switch to creative mode. Now that you have console access, you can switch to creative mode. This is the only mode that lets you place and program command blocks. Use the following command to accomplish this:
- Hit T to open the console (the chat bar), or press / to open it and automatically enter / to the line you are typing.
- Type /gamemode c and hit Enter to enter creative mode.
- Once you’re done setting up command blocks, type /gamemode s for survival mode or /gamemode a for adventure mode.
-
4
Create command blocks. Open the console again with T and type this command: /give (yourusername) minecraft:command_block 64 . Instead of (yourusername), type in your full Minecraft username, without parentheses.
- Your username is case sensitive.
- If nothing happens, you may need to update minecraft to at least version 1.4. Update to the latest version to get access to all commands.
- You can replace the «64» with any number to receive that many blocks. 64 makes a full stack of command blocks.
Advertisement
-
1
Place a command block. Check your inventory and look for the command blocks you just created. The icon is a brown, patterned box with grey control panels on each side. Move the command blocks to your quick slot and place one on the ground, just as you would any item.
-
2
Open the command block interface. Walk up to the command block and right-click to open it, as you would a chest. A window should pop up with a text box.
- If nothing happens, command blocks might be disabled on your multiplayer server. Someone with access to the server.properties file will need to open that file and set enable-command-block to «true» and op-permission-level to «2» or higher.
-
3
Enter a command. You can enter just about any command in the command block’s text field, then press Done to save it in the block. There’s a long list of commands included below, but try summon Sheep for your first experiment.
- To learn more commands, open the regular console (not the command block) and type /help.
- Unlike the regular console, a command block’s text box does not need to start with the / symbol.
-
4
Activate the block with redstone. Connect a trail of redstone dust to the command block, and place a pressure plate on top of the redstone. Walk over the pressure plate to activate the redstone, and a sheep should appear next to the block. This will happen whenever any player or mob activates the redstone.
- This works just like a regular redstone activation. You can replace the pressure plate with a button, lever, or other activation method of your choice. You can even place the button directly on the command block.
- Anyone can use the command block once it’s set up, but only players with the right permissions can change the command.
-
5
Learn the special syntax. For the most part, command block text works the same as the regular console. If you aren’t familiar with the console yet, check out the example section below to get started. If you already know how to use console commands, these are the only extra terms you need to learn:
- @p targets the player nearest to the command block, no matter how far away she is.
- @r targets a random player, anywhere on the server.
- @a targets every single player on the server, including yourself.
- @e targets every «entity» on the server. This includes practically anything that isn’t a block, including players, objects, enemies, and animals. Be careful messing with this one.
- You can use these terms wherever you would use a player name or entity name (although these terms still work fine).
-
6
Modify the syntax for more control (optional). You can create extra-specific commands by adding modifiers after @p, @r, @a, or @e. These use the at [(argument)=(value)]. There are many different arguments and values available. You can look up the full list online, but here are some examples to get you started:
- A command that includes @r[type=Sheep] will affect a random sheep.
- @e[m=c] affects everyone in creative mode. The «m» argument stands for mode, and «c» stands for creative.
- Use the ! symbol to make the opposite value. For example, @a[team=!Commando] will affect every player not on team Commando. (Teams only exist on special player-made maps.)
-
7
Use the Tab key for help. If you know a command, but aren’t sure what you can use it for, press Tab and the game will fill it out for you. Press Tab a second time to scroll through a list of options.
- For example, go back to your sheep-summoning block and delete the word «Sheep.» Press Tab to cycle through a list of possible entities to summon.
Advertisement
-
1
Make a teleportation box. Save the command tp @p x y z into a command block. Instead of x, y, and z, enter the x-, y-, and z-coordinates of the location you’d like to teleport (for example, /tp @p 0 64 0). When anyone activates this box, the player nearest to the box will vanish and reappear at those coordinates.
- Press F3 to display coordinates.
- Just like any command, you can replace the «@p» with another term. If you type your username, you’ll always be the one teleported, even if someone else activates the block. If you use @r, a random player on the server will be teleported.
-
2
Spawn objects or blocks. Assuming you’re using Minecraft 1.7 or later, you can make command blocks to summon any entity or block. Here are some examples:
- A command block with summon Boat stored will add a new boat next to the block every time the block becomes activated. The people of your server will never need to wait for a ferry again.
- To spawn a block instead of an entity, use the setblock command instead of the summon command. setblock minecraft:water 50 70 100 turns the block at the coordinates 50-70-100 into water. If there was already a block there, it disappears.
-
3
Destroy objects or players. The kill command will permanently destroy an entity. This one is dangerous to use, since a typo could end up destroying the wrong thing (or even your entire world if you use @e). kill @r[type=Painting,r=50] destroys a random painting within a 50 block radius of the command block.
-
4
Control time and weather. time set day or time set 0 will set the level of sunlight to the specified amount. Try different values instead of 0 to make it any time you like. Once you’re tired of ruling over perpetual sunshine, make a block with toggle downfall or weather rain to start the rain.
-
5
Try out even more commands. There are hundreds of commands, which you can find by using /help or searching Minecraft websites. Here are a few more to explore:
- say (message)
- give (player) (item) (number of that item)
- effect (player) (potion effect)
- gamerule
- testforblock
Advertisement
Add New Question
-
Question
What do I do if the command summoned a zombie, but didn’t put armor on it?
You need to specify if the zombie has armor:
(/summon Zombie) will tell minecraft to summon a regular zombie with nothing extra, like weapons or armor. To summon a zombie with armor, do :
/summon Zombie ~ ~ ~ {Equipment:[{id:minecraft:leather_boots},{id:minecraft:leather_leggings},{id:minecraft:leather_chestplate} {id:minecraft:leather_helmet}]}. -
Question
How do I spawn animals?
Enter summon, and then press tab to select what to summon. You can summon anything from every single mob to a lightning bolt.
-
Question
How do I destroy blocks with command blocks?
The «setblock» command places blocks, including air»blocks», so «setblock minecraft:air [x] [y] [z]» (without the quotes) should remove a block, or actually replace by air.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
-
In the regular console, type /help for a list of commands. Type /help (command name) to learn about a specific command. You can also find more information at Minecraft wikis and community websites.
-
To turn off the chat notifications for a successful command, open the regular console and enter /gamerule commandBlockOutput false.
-
Nothing happens when the signal to a command block turns off. The command block will trigger again once the signal returns.
Show More Tips
Thanks for submitting a tip for review!
Advertisement
-
A redstone signal must be boosted by a redstone repeater if it travels more than 15 blocks.
-
You must click Done to save a command block. Closing the window by pressing Esc will not save your command.
Advertisement
About This Article
Article SummaryX
1. Enter a world in which you have console access.
2. Switch to creative mode.
3. Type «/give (yourusername) minecraft:command_block (number of blocks)» at the console.
4. Place and open a command block.
5. Run a command and click Done.
Did this summary help you?
Thanks to all authors for creating a page that has been read 187,804 times.
Did this article help you?
Minecraft — игра, каждый элемент которой можно легко настроить под себя: как при помощи модов, так и через командную строку. С помощью последней доступно очень многое: например, заспавнить командный блок или изменить время суток. О том, как включить этот инструмент и для чего его использовать, мы и расскажем в этом гайде.
Как включить читы?
Тут всё очень просто. При создании нового мира переключите пункт «Использование читов» на «Вкл».
Есть возможность включить читы и в уже созданном мире. Для этого:
- Зайдите в нужный мир.
- Нажмите ESC.
- Выберите «Открыть для сети».
- Переключите «Использование читов» на «Вкл».
- Нажмите «Открыть мир для сети».
Чтобы проверить, всё ли работает, откройте чат (клавиша «T» по умолчанию) и впишите команду «/time set day» (без кавычек). При успешном выполнении в чате появится сообщение: «Установлено время: 1000», а время суток сменится на день (для ночи смените в команде «day» на «night»).
Ещё пара интересных команд, которые стоит попробовать:
- «/clone x1 y1 z1 x2 y2 z2 x y z» — клонирует блоки из области с начальными координатами «x1 y1 z1» и конечными «x2 y2 z2» в точку «x y z». Полезно, если строите город и хотите размножить однотипные домики.
- «/tp Player x y z» — телепортирует игрока в указанные координаты. Вместо «Player» вводите ник игрока, которого хотите переместить.
- «/gamerule keepInventory true» — после смерти все предметы останутся в инвентаре. Чтобы вернуть, как было, замените «true» на «false».
Остальные консольные команды можно посмотреть на Minecraft Wiki, либо в чате игры, прописав «/help».
Как получить командный блок?
Одна из самых интересных вещей, которую можно получить только с помощью читов, — командный блок. В него можно записать все те же команды, что и в командную строку, и включать их сигналом редстоуна. Вариантов применения у такого предмета множество — от создания телепорта до сложных серверных механизмов.
Для получения командного блока нужно прописать в чате «/give @s command_block N», где N — количество блоков, которое хотите получить.
Ставить и использовать командный блок могут только игроки в режиме креатива. Включить его можно командой «/gamemode creative Player».
Как использовать командный блок?
ПКМ по блоку откроет его интерфейс. В верхнюю строку вписываем текст команды (здесь писать «/» не нужно), например «give @p iron_axe 3», и жмём «Готово».
Теперь подключим редстоун-сигнал. Подать его можно рычагом, кнопкой или нажимной плитой. Поместить кнопку или рычаг на блок можно нажатием «Shift+ПКМ».
После нажатия на кнопку команда исполнится, и в инвентаре появится три железных топора.
Поздравляем, теперь вы владеете основами работы с командным блоком. Остальное зависит уже от вашей фантазии!
Как выдать командный блок?
Если вы хотите поручить это дело кому-нибудь другому, выдать командный блок можно, прописав в чат «/give Player command_block N». Не забудьте вписать вместо «Player» ник нужного игрока, а вместо «N» — количество выдаваемых блоков.
Как сделать невидимую рамку?
Ещё одна полезная штука, которую можно достать только с помощью читов, — невидимая рамка.
С её помощью можно повесить мечи над камином, сделать подставку для свечей, вывеску для магазина и много других украшений.
Получить такую рамку можно, прописав в чат команду «/give @s item_frame{EntityTag:{Invisible:1b}} N» (замените «N» на необходимое количество).
Вот и всё. Пробуйте, экспериментируйте и не забывайте делиться своими идеями в комментариях!
Рекомендуем играть в Minecraft на мониторе LG UltraGear 27GN850-B. Это отличная 27-дюймовая модель с QHD-разрешением и частотой развёртки 144 Гц. Матрица у неё построена по самой современной технологии nano-IPS с дополнительным цветовым фильтром, который позволил реализовать 10-бит цветовой охват и поддержку HDR.
Если вы до сих пор еще не знаете, что такое командный блок, то эта статья написана именно для вас. Давайте разберемся в этом вопросе, изучив его более подробно!
Вполне возможно, что данный предмет не особо знаком вам, более того, его использование и активация в данной игре вообще являются загадками. Но если вы начнете играть по сети, то вам будет полезно знать, как пользоваться командным блоком в Майнкрафт, и для чего он нужен. Однако, обо все по порядку!
Как вы уже заметили, игра Minecraft дает возможность каждому своему пользователю взаимодействовать со множеством различных блоков. Они отличаются друг от друга по функциям, внешнему виду и размещением в пространстве. Собрав всех их воедино, каждый герой словно открывает для себя новый мир!
Существует очень много различных блоков, которые можно носить в качестве инвентаря и затем снова разместить в игре. Из них после процесса переработки можно получать различные материалы, которые впоследствии так же можно подвергать изменению.
Собственно, вся суть в Майнкрафте и основана на блоках. Среди них имеется один, который совершенно не такой, как все — это командный блок. Его, скорее всего, можно отнести к так называемым консольным командам, которые имеют большое значение в игре. Давайте разберемся, почему.
Команды в Minecraft
Трудно догадаться о наличии консоли, если постоянно играть лишь в одиночном режиме. А все потому, что она имеет значение только во многопользовательском режиме. Благодаря ей, игровой функционал значительно расширяется. Серверный админ управляет игровым процессом, используя консоль, в которой он прописывает команды. Командный блок в игре делает тоже, только немного по-другому. Чтобы было понятнее, давайте разберем принцип использования команд.
Если администратор желает внести изменения в игру, то ему нужно всего лишь вызвать консоль и вписать в нее соответствующую команду. Он может вносить изменения на любом этапе игрового процесса, начиная от незначительных корректировок (введение в игру дополнительных мобов) и заканчивая изменениями внушительного характера (сменой режима игры).
Таким образом, админ с помощью команд имеет возможность сделать игру такой, какой он ее себе представляет. Он приравнивается в игре Minecraft к создателю с неограниченными возможностями. Но если администратор имеет возможность активировать команды, всего лишь посредством ввода их в консоль, то нужно ли что-то еще?
Для чего нужен командный блок в Майнкрафте?
Любители игры (не все, конечно же, но большая их часть) даже и не задумываются о том, что в ней существует командный блок. Но даже когда они в курсе того, что он есть, то как им пользоваться, не имеют ни малейшего понятия. Хотя в этом нет ничего сложного. С помощью этого блока автоматизируются некоторые команды и создаются точные условия и события.
Иными словами, как только админ разместит на карте командный блок, а так же пропишет для него конкретные команды, а игрок совершит активацию, в игровом пространстве наступит новое событие. Можно очень многое прописать в поле блока, например, какими будут эффекты или на кого они будут действовать. Как видите, для того, чтобы сделать игру разнообразнее, достаточно всего лишь воспользоваться командными блоками в Minecraft.
Кто имеет доступ к командному блоку?
Командный блок в версии Майнкрафт 1.5.2, ну и, конечно же, в тех релизах, что вышли позже, является не только мощным, но и очень функциональным объектом. И здесь не поспоришь. Это является причиной того, что для простого игрока он недоступен. Им могут пользоваться только лишь серверные админы. Его невозможно создать или получить путем выбивания из мобов в процессе игры.
Есть, конечно же, один вариант для простых игроков, но пользуясь им, будьте готовы к тому, что вас могут в тот же миг забанить. Речь идет о чит-кодах. Но даже если бан и обойдет вас стороной, то это еще не означает, что вы сможете иметь доступ к серверу. А все потому, что использование вами командного блока не сможет остаться незамеченным.
То есть, у вас один вариант — играть согласно правилам. Но все же, есть и другой способ: создайте свой сервер самостоятельно и тогда управление в игре будет целиком и полностью только лишь в вашем распоряжении.
Как пользоваться командным блоком в Minecraft?
Командный блок очень прост в использовании. Для начала нужно прописать команду: правой клавишей мышки администратор вызывает на экран окно с полем. В этом поле он указывает все, что для этого необходимо: условия, команды и так далее. К примеру, сообщения в виде текста, адресованные игрокам. Следующее, что должен сделать админ, это поместить блок в игру. А там его уже найдут игроки.
Обязательно возле каждого такого блока должен быть установлен камень красного цвета. Он, если его активировать, даст сигнал на командный блок. Для того, чтобы эта команда была постоянной или же периодической с одинаковыми промежутками, нужно всего лишь задать условия определенным образом.
То есть, зная, как использовать командный блок в Minecraft, вы можете задавать конкретные условия для выполнения необходимой вам команды. А так как эти команды могут быть какими угодно, то игрокам на вашем сервере будет интересно играть в зависимости от созданных тут условий игры.
Как активировать командный блок в Майнкрафте?
В Minecraft камень красного цвета имеет свое особое назначение: он приводит в работу командный блок. Вы спросите: как его активировать? Все очень просто! Для создания собственного сервера нужно полностью все настраивать по отдельности под себя. Вас ждет очень много работы. Для того, чтобы решить вопрос о том, будет или не будет у вас командного блока, вам необходимо зайти на сервер, а точнее — в его свойства. Там вы увидите следующую запись:
enable-command-block
Если укажите true, то так вы активируете блок, а если выберете false, то отключите его.
Заключение
Нам будет очень приятно знать, что информация из данной статьи стала для вас полезной. Можете написать комментарий, в котором дадите ей объективную оценку. Расскажите друзьям об этом ресурсе! Благодарим вас за внимание!
Мы ждём Ваши комментарии, смело пишите!
A command block is a block that can execute commands. Because it cannot be obtained or edited in Survival mode without cheats, it is primarily used on multiplayer servers, in Creative worlds, and custom maps.
An impulse command block is the default block type, it executes only once when activated.
A chain command block executes every time when triggered.
A repeating command block executes every game tick as long as it is activated.
Obtaining
In Java Edition, command blocks are available in the Creative inventory under the «Operator Utilities» tab, if the «Operator Items Tab» setting in the «Controls» Options tab is set to «ON». Across both Java and Bedrock editions, they can either be obtained by using the pick block control, or by using various commands, such as /give @s minecraft:command_block
, or /setblock ~ ~ ~ command_block
.
Just like other blocks that can store NBT data, using pick block + CTRL copies the command and options inside the command block. This allows it to be placed elsewhere without having to re-enter the data inside.
Command blocks are not flammable, and have the same blast resistance as bedrock. Command blocks, structure blocks, and jigsaw blocks cannot be mined in Survival.
Command blocks can be placed by a non-operator player.
Usage
A command block can execute commands when activated by redstone power. It always has permissions of 2 level[Java Edition only]/1 level[Bedrock Edition only], so it can be used to allow a specific use of a command by players who can’t use that command in general (for example, allowing anyone to obtain a specific item with /give
without allowing everyone to /give themselves whatever they want).
A command block has an orientation that determines the chain command block to activate, and the blocks to be checked to see if a command block in «Conditional» mode executes.
To execute the command, in Java Edition in multiplayer enable-command-block
in the server.properties file must be set to true
(default is false
); in Bedrock Edition «Command Blocks Enabled» in options must be enabled.
Modification
Java Edition command block GUI
To enter command or modify the command block, use the Use Item control on the command block to open the command block GUI (graphical user interface). The GUI opens only if the player is in Creative mode, and has the proper permissions. That means, in singleplayer, «Allow Cheats»[JE only] or «Activate Cheats»[BE only] in options must be enabled. In multiplayer, Gui can be opened only by operators in Creative mode, and in Java Edition op-permission-level
in the server.properties file must be set to 2
or above (default is 4).
In Java Edition to enter command or modify the command block, enable-command-block
in the server.properties file must be set to true
(default is false
).
Bedrock edition command block GUI
In Java Edition, opening the GUI in singleplayer pauses the game.
- Console Command[JE only]/Command Input[BE only]
- Commands can be entered in the top text pane. The text limit for commands in a command block is 32,500 characters, but the text pane can show only a small portion of this amount at a time.
- Commands in a command block do not need to be prefixed with the forward-slash (
/
) as they do in the chat window, but doing so still works.
- Press Tab ↹ to complete words or cycle through options.
- In Bedrock Edition, below the console command text pane are some reminder tips about how to use target selectors.
- Previous Output
- The bottom text pane displays the output message (success or failure) of the last executed command (it is blank[JE only] or «
-
«[BE only] initially). Its text is not editable.
- A button to the right of the Previous Output text pane[JE only] or the left of the «Previous Output»[BE only] specifies whether the last output should be stored and displayed. It is
O
[JE only]/enabled[BE only] when the output text should be stored andX
[JE only]/disabled[BE only] when the output text should not be stored. For worlds with many command blocks, especially command blocks running on fast clocks, not storing the output text can reduce memory and storage requirements.
- If gamerule
sendCommandFeedback
is true (the default), default toO
[JE only]/enabled[BE only]. Otherwise defaults toX
[JE only]/disabled[BE only].
- Block Type
Left: «Impulse» block type.
Middle: «Chain» block type.
Right: «Repeating» block type.
Top: «Unconditional» mode.
Bottom: «Conditional» mode.
- Click the «Impulse/Chain/Repeat»[JE only]/»Block Type»[BE only] button to change the command block’s type. The default state is «Impulse», but non-default command blocks can be obtained and placed. The command block also changes color when changing its command block type:
-
- «Impulse» command blocks are orange. They execute once every time they are activated.
- «Chain» command blocks are green. They execute once every time they are triggered if they have been activated.
- «Repeat» command blocks are purple. They execute their commands once every one game tick (or more[BE only]) as long as they are activated.
- Condition
- Click the «Conditional/Unconditional»[JE only]/»Condition»[BE only] button to change the command block’s conditional behavior:
- «Conditional»: A command block in conditional mode executes its command only when the command block behind it has executed successfully («Success count» is greater than 0).
- «Unconditional» (default): A command block in unconditional mode executes its command even if there’s a command block behind it that didn’t execute its command successfully.
- «Behind it» in the sense of opposite to the direction the command block is facing, regardless of chain direction or even if chaining is occurring.
- Redstone
- Click the «Always Active/Needs Redstone»[JE only]/»Redstone»[BE only] button to change the command block’s activation requirements:
- «Needs Redstone» (the default for impulse and repeat command blocks): A command block in the «Needs Redstone» setting can be activated only with redstone.
- «Always Active» (the default for chain command blocks): The command block is activated when set to «Always Active». Then it is always active even without redstone activation.
- Execute on First Tick[BE only]
- Specifies whether a repeat command block executes its command as soon as it is activated. If it’s disabled, executes the first time after the delay from the time when it is activated.
- Delay in Ticks[BE only]
- For impulse or chain command block, specifies how many game ticks it delays before executing a command after it is activated or triggered.
- For repeat command block, specifies how many game ticks it delays to execute again.
- Note that for impulse or repeat command block, 0 and 1 work the same; the game takes 0 as 1. However, For chain command block, 0 and 1 are different.
- Hover Note[BE only]
- Specifies the name of the command block, which can be seen when you point to the block. It is also used for message commands. If the command block had been named in an anvil before placement, that name is used as well. If it is empty, defaults to
!
.
- Done
- In Java Edition, click the «Done» button or ↵ Enter to save the command and leave the command block GUI.
- In Bedrock Edition, close the GUI to save the command and changes.
- Cancel
- Click the «Cancel» button or Esc[JE only]to leave the command block GUI without saving any changes.
Activation
Command blocks are redstone mechanisms and can be activated by:
- An adjacent active power component: for example, a lever, a block of redstone, a daylight sensor, a button etc.
- An adjacent powered block (for example, an opaque block with an active redstone torch under it)
- A powered redstone comparator or redstone repeater facing the mechanism component
- Powered redstone dust configured to point at the command block (or on top of it) or directionless; a command block is not activated by adjacent powered redstone dust that is configured to point away from it.
A command block can also be activated by setting it to «Always Active» mode.
When activated, a command block executes its command, depending on the command block’s type:
- An impulse command block executes its command once.
- A chain command block does not execute its command until it is triggered.
- A repeat command block executes its command once every one game tick (or more[BE only]) until no longer activated.
Execution
An impulse command block, when it is activated, checks whether the command block behind it has executed successfully (if in conditional mode). After the delay of 1 game tick (or more[BE only]), if the condition is met before the delay (if in «Conditional» mode), it executes its command once and triggers the chain command block it is pointing to.
A repeat command block, when it is activated, after 1 game tick (always 1 no matter how many «Delay in Ticks» is), checks whether the command block behind it has executed successfully (if in conditional mode). If the condition is met, and if «Execute on First Tick» is enabled in Bedrock Edition, it executes its command once and triggers the chain command block it is pointing to. If it is still activated, it then checks, executes, and triggers the chain command block again after 1 game tick (or more[BE only]).
When executing a command, it also updates its success count: If in «Conditional» mode, if the command block behind it didn’t execute successfully, it sets its success count to 0. Otherwise, it sets it to the success count of the command.
Also:
- When an impulse or repeat command block in «Needs Redstone» mode with a command is placed or is cloned by a command to a powered location, the new command block executes its command only if it hasn’t been activated with redstone. In Java Edition, it also needs a block update to execute its command.
- When an impulse or repeat command block in «Always Active» mode with a command is placed or is cloned by a command to a powered location, the new command block executes its command only if it hasn’t been activated with redstone.
- When an impulse or chain command block is set to «Repeat», if it has been activated, checks whether the command block behind it has executed successfully (if in conditional mode). After 1 game tick (always 1 no matter how many «Delay in Ticks» is), if the condition is met, it executes its command once and triggers the chain command block it is pointing to. Then it checks, executes, and triggers the chain command block again after 1 game tick (or more[BE only]).
Trigger and chaining
If any command block having executed its command (whether successfully or unsuccessfully) faces a chain command block, it triggers the chain command block to also attempt execution.
When a chain command block is triggered,
- If it has been activated,
- It checks whether it is in «Conditional» mode and the command block behind it hasn’t executed successfully (Behind in the sense of the direction it is facing, not in the sense of which command block chained to it),
- If true, it triggers another chain command block it is facing, without executing the command.
- If false, it checks whether it has been already executed in this game tick. If false, it executes the command and triggers another chain command block it is facing. If true, it does nothing. That means that chained execution cannot be passed to a command block that has already executed in that game tick (loops execute only once).
- It checks whether it is in «Conditional» mode and the command block behind it hasn’t executed successfully (Behind in the sense of the direction it is facing, not in the sense of which command block chained to it),
- If it has not been activated, it triggers the chain command block it is facing to attempt execution.
Chained command blocks execute simultaneously in the same game tick in the order they are chained.
In Bedrock Edition, it can also delay before executing commands if «Delay in Ticks» is not 0:
- When it is triggered,
- If it has been activated, the chain command block checks whether the command block behind it has executed successfully (if in conditional mode), then it delays.
- After a delay, if the condition is met before the delay (if in «Conditional» mode), it executes its command once and triggers the chain command block it is pointing to no matter whether the condition met.
- If it has not been activated, it triggers (without delay) the chain command block it is facing to attempt execution.
- If it has been activated, the chain command block checks whether the command block behind it has executed successfully (if in conditional mode), then it delays.
In Java Edition, it can execute multiple times in the same game tick if «UpdateLastExecution» is set to false. In this case, it does not check whether it has already executed in this game tick.
If the chain command block has been activated when triggered, it also updates its success count: If in «Conditional» mode, if the command block behind it didn’t execute successfully, it sets its success count to 0. Otherwise, it sets it to the success count of the command.
Output
When activated, a command block can produce multiple types of output:
Success count
- A command block can power a redstone comparator facing away from it (possibly separated by a block) with signal strength specific to the success count. Success count is an integer between 0 to 2,147,483,647 (inclusive).
- The signal strength always reflects the last command executed, even after the command block is deactivated.
- In Java Edition, success count is usually 0 or 1, except for
/function
and/execute
.
- In Bedrock Edition, success count is an integer related to the command (e.g., the number of players affected by the command, the number of blocks that were altered, the value returned by the command, etc.)
- In Java Edition, leaving the command block GUI by clicking «Done» or pressing ↵ Enter resets the success count to 0, regardless of whether changes were made in the GUI. In Bedrock Edition, leaving the GUI with changes resets the success count to 0.
Message
- The output message describes the success or failure of the executed command, and may be written to multiple destinations:
- Previous Output: The output message is always written to the «Previous Output» text pane of the command block GUI.
- Chat: The output message is written to the chat text in singleplayer mode, or broadcast to all other ops in multiplayer mode, unless it has been suppressed with
/gamerule commandBlockOutput false
. Some commands may write additional text to the chat as their normal function, which won’t be suppressed (for example, the/say
command writes a message to the chat of all players), separate from the output message. Chat messages that would usually be prefaced by a player’s name (such as from the/me
,/say
and/tell
commands) use@
[Java Edition only] /!
[Bedrock Edition only] as the player name. If the command block had been named in an anvil before placement, that name is used instead. In Bedrock Edition, it can also modified in the GUI.
- Logs: The output message is written to multiplayer server logs unless it has been suppressed with
/gamerule logAdminCommands false
.
Notes
Command blocks execute commands with OP level 2. The following commands cannot be used in a command block: /ban
, /banlist
, /ban-ip
, /debug
, /deop
, /kick
[JE only], /op
, /pardon
, /pardon-ip
, /publish
, /reload
[BE only], /save-all
, /save-off
, /save-on
, /stop
, and /whitelist
(i.e., /debug
, /publish
, and all of the multiplayer-only commands except /list
).
Easter eggs
Running «Searge» (case insensitive) as the command in the command block without a preceding «/
» will set the previous output to «#itzlipofutzli». Its success count is 1.
Piston interactivity
Command blocks cannot be pushed by pistons. They also cannot be pushed or pulled by sticky pistons.
Sounds
Java Edition:
Sound | Subtitles | Source | Description | Resource location | Translation key | Volume | Pitch | Attenuation distance |
---|---|---|---|---|---|---|---|---|
Block broken | Blocks | Once the block has broken | block.metal.break |
subtitles.block.generic.break |
1.0 | 1.2 | 16 | |
Block placed | Blocks | When the block is placed | block.metal.place |
subtitles.block.generic.place |
1.0 | 1.2 | 16 | |
Block breaking | Blocks | While the block is in the process of being broken | block.metal.hit |
subtitles.block.generic.hit |
0.25 | 0.75 | 16 | |
None[sound 1] | Entity-Dependent | Falling on the block with fall damage | block.metal.fall |
None[sound 1] | 0.5 | 1.25 | 16 | |
Footsteps | Entity-Dependent | Walking on the block | block.metal.step |
subtitles.block.generic.footsteps |
0.15 | 1.5 | 16 |
- ↑ a b MC-177082
Bedrock Edition:
Sound | Source | Description | Resource location | Volume | Pitch |
---|---|---|---|---|---|
Blocks | Once the block has broken | dig.stone |
1.0 | 1.1-1.2 | |
Blocks | When the block is placed | use.stone |
1.0 | 1.2-1.25 | |
Blocks | While the block is in the process of being broken | hit.stone |
0.3 | 0.75 | |
Players | Falling on the block with fall damage | fall.stone |
0.4 | 1.0 | |
Players | Walking on the block | step.stone |
0.35 | 1.0 | |
Players | Jumping from the block | jump.stone |
0.12 | 1.0 | |
Players | Falling on the block without fall damage | land.stone |
0.22 | 1.0 |
Data values
ID
Java Edition:
Name | Identifier | Form | Block tags | Translation key |
---|---|---|---|---|
Command Block | command_block |
Block & Item | dragon_immune wither_immune |
block.minecraft.command_block |
Chain Command Block | chain_command_block |
Block & Item | dragon_immune wither_immune |
block.minecraft.chain_command_block |
Repeating Command Block | repeating_command_block |
Block & Item | dragon_immune wither_immune |
block.minecraft.repeating_command_block |
Name | Identifier |
---|---|
Block entity | command_block |
Bedrock Edition:
Name | Identifier | Numeric ID | Form | Item ID[i 1] | Translation key |
---|---|---|---|---|---|
Command Block | command_block |
137 |
Block & Giveable Item[i 2] | Identical[i 3] | tile.command_block.name |
Chain Command Block | chain_command_block |
189 |
Block & Giveable Item[i 2] | Identical[i 3] | tile.chain_command_block.name |
Repeating Command Block | repeating_command_block |
188 |
Block & Giveable Item[i 2] | Identical[i 3] | tile.repeating_command_block.name |
- ↑ ID of block’s direct item form, which is used in savegame files and addons.
- ↑ a b c Available with
/give
command. - ↑ a b c The block’s direct item form has the same id with the block.
Name | Savegame ID |
---|---|
Block entity | CommandBlock |
Block states
Java Edition:
Name | Default value | Allowed values | Description |
---|---|---|---|
conditional | false |
false true |
True if the command block is in conditional mode. |
facing | north |
down east north south up west |
The direction the command block is pointing. |
Bedrock Edition:
Name | Metadata Bits | Default value | Allowed values | Values for Metadata Bits |
Description |
---|---|---|---|---|---|
conditional_bit | 0x8 |
false |
false true |
0 1 |
True if the command block is in conditional mode. |
facing_direction | 0x1 0x2 0x4 |
0 |
0 1 2 3 4 5 |
0 1 2 3 4 5 |
The direction the command block is pointing.
|
Block data
A command block has a block entity associated with it that holds additional data about the block.
Java Edition:
- Block entity data
- auto: 1 or 0 (true/false) — Allows to activate the command without the requirement of a redstone signal.
- Command: The command to issue to the server.
- conditionMet: 1 or 0 (true/false) — Indicates whether a conditional command block had its condition met when last activated. True if not a conditional command block.
- CustomName: Optional. The name JSON text component of this command block, replacing the usual ‘@’ when using commands such as
/say
and/tell
. - LastExecution: stores the tick a chain command block was last executed in.
- LastOutput: The last line of output generated by the command block. Still stored even if the game rule
commandBlockOutput
isfalse
. Appears in the GUI of the block when right-clicked, and includes a timestamp of when the output was produced. - powered: 1 or 0 (true/false) — States whether or not the command block is powered by redstone or not.
- SuccessCount: Represents the strength of the analog signal output by redstone comparators attached to this command block.
- TrackOutput: 1 or 0 (true/false) — Determines whether the LastOutput is stored. Can be toggled in the GUI by clicking a button near the «Previous Output» textbox. Caption on the button indicates current state: «O» if true, «X» if false.
- UpdateLastExecution: 1 or 0 (true/false) — Defaults to true. If set to false, loops can be created where the same command block can run multiple times in one tick.
Bedrock Edition:
- See Bedrock Edition level format/Block entity format.
History
Java Edition | |||||
---|---|---|---|---|---|
July 27, 2012 | Jeb began tweeting of a new block he had created to start expanding Adventure mode. He began posting pictures, ideas and hints of what the block can do. | ||||
July 31, 2012 | During Notch’s AMA on Reddit, he hinted the block may be in Java Edition 1.4. | ||||
1.4.2 | 12w32a | Added command blocks. | |||
12w38a | Added the game rule commandBlockOutput . |
||||
1.5 | 13w03a | Command block success can now power a redstone comparator. | |||
13w04a | Command blocks renamed with an anvil now use their name instead of @ in the chat. | ||||
13w10a | Pressing Esc in a command block will exit its GUI. | ||||
1.6.1 | 13w19a | Command blocks are no longer mineable in Survival. | |||
Command blocks are no longer damaged by explosions, except by blue wither skulls. | |||||
1.7.2 | 13w37a | A bar that shows the previous output of command blocks has been added. | |||
The character limit when inserting a command in a command block has been increased from 256 to 16,369. Using a third-party editor allows the player to reach 32,767 characters. | |||||
1.8 | 14w07a | Dispensers now place command blocks, instead of shooting them out. | |||
14w20a | The in-game character limit of 16,369 has been removed, allowing access to the full 32,767 characters. | ||||
14w27a | Added CommandStats NBT tag to command blocks. | ||||
1.8.6 | Dispensers no longer place command blocks.[1] | ||||
1.9 | 15w33a | The character limit for command blocks is now 32,500 instead of 32,767. | |||
15w34a | Added the chain command block and the repeating command block. | ||||
Added block facing for command blocks. | |||||
The texture of command blocks has been changed. | |||||
15w34b | Added Conditional mode within command blocks. | ||||
Added tab completion support within command blocks. | |||||
15w35a | The textures of all three command blocks have been changed. | ||||
When command blocks are set to conditional, the back of the arrow texture is now curved. | |||||
Added Always active and needs redstone options for command blocks. | |||||
Added auto NBT tag to control redstone options within command blocks. |
|||||
15w36a | Players are now unable to use commands, such as /give , within command blocks.
|
||||
Players, who are unable to use commands, can no longer place command blocks. | |||||
15w36d | Each command block type now appears with different colors on maps. | ||||
16w02a | Running /help in a command block now randomly uses one of various different humorous phrases as the previous output. |
||||
16w04a | Running «Searge» as the command in the command block without a preceding «/ » now sets the previous output to «#itzlipofutzli». |
||||
1.11 | 16w32a | The block entity ID has been changed from Control to command_block . |
|||
1.12 | 17w16a | Chains of command blocks no longer schedule their commands to be run in the next tick. Instead, they now execute all in the same tick they are read. This allows later blocks in a chain to be modified via earlier blocks, allowing techniques like branching and looping, all in the same tick. | |||
17w16b | Added the game rule maxCommandChainLength to control the max length of a command block chain. |
||||
17w17a | Added UpdateLastExecution and LastExecution NBT tags, which control the tracking of which tick a chain command block was last executed in. |
||||
pre6 | Tab-completing command names in command blocks no longer add a / prefix. |
||||
1.13 | 17w47a | Prior to The Flattening, the numeral IDs for the command block, repeating command block, and chain command block were 137, 210, and 211, respectively. | |||
pre1 | The player can now tab-complete in command blocks again. | ||||
1.14 | 18w43a | The textures of command blocks have been changed. | |||
18w47b | The textures of impulse and repeating command blocks have been changed. | ||||
1.19.3 | 22w44a | Command blocks are now available in the creative inventory, but only if cheats are enabled. | |||
22w45a | Moved command blocks behind the Operator Utilities tab in the creative inventory. The tab is only available if cheats are enabled and the «Operator Items Tab» option in the controls menu is turned on. | ||||
Pocket Edition | |||||
1.0.5 | alpha 1.0.5.0 | Added all types of command blocks. | |||
Bedrock Edition | |||||
1.8.0 | beta 1.8.0.8 | Command blocks now have a default name of ! instead of @ . |
|||
1.10.0 | beta 1.10.0.3 | The textures of command blocks have been changed. | |||
1.12.0 | beta 1.12.0.2 | Tab-complete has been added to command blocks. | |||
Added a delay option to command blocks, which allows a delay to be added to a redstone tick delay field. | |||||
Legacy Console Edition | |||||
TU19 | CU7 | 1.12 | Patch 1 | Added command blocks. | |
Command blocks do not have any functionality and can be obtained only with mods. |
Issues
Issues relating to «Command Block» are maintained on the bug tracker. Report issues there.
Gallery
-
The first image released by Mojang of the command block.
-
The second image released by Mojang showing the block giving glass to the player.
References
- ↑ https://bugs.mojang.com/browse/MC-80671?focusedCommentId=228546&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-228546
External Links
- Block of the Week: Command Block – Minecraft.net on April 27, 2018
A command block is a block that can execute commands. Because it cannot be obtained or edited in Survival mode without cheats, it is primarily used on multiplayer servers, in Creative worlds, and custom maps.
An impulse command block is the default block type, it executes only once when activated.
A chain command block executes every time when triggered.
A repeating command block executes every game tick as long as it is activated.
Obtaining
In Java Edition, command blocks are available in the Creative inventory under the «Operator Utilities» tab, if the «Operator Items Tab» setting in the «Controls» Options tab is set to «ON». Across both Java and Bedrock editions, they can either be obtained by using the pick block control, or by using various commands, such as /give @s minecraft:command_block
, or /setblock ~ ~ ~ command_block
.
Just like other blocks that can store NBT data, using pick block + CTRL copies the command and options inside the command block. This allows it to be placed elsewhere without having to re-enter the data inside.
Command blocks are not flammable, and have the same blast resistance as bedrock. Command blocks, structure blocks, and jigsaw blocks cannot be mined in Survival.
Command blocks can be placed by a non-operator player.
Usage
A command block can execute commands when activated by redstone power. It always has permissions of 2 level[Java Edition only]/1 level[Bedrock Edition only], so it can be used to allow a specific use of a command by players who can’t use that command in general (for example, allowing anyone to obtain a specific item with /give
without allowing everyone to /give themselves whatever they want).
A command block has an orientation that determines the chain command block to activate, and the blocks to be checked to see if a command block in «Conditional» mode executes.
To execute the command, in Java Edition in multiplayer enable-command-block
in the server.properties file must be set to true
(default is false
); in Bedrock Edition «Command Blocks Enabled» in options must be enabled.
Modification
Java Edition command block GUI
To enter command or modify the command block, use the Use Item control on the command block to open the command block GUI (graphical user interface). The GUI opens only if the player is in Creative mode, and has the proper permissions. That means, in singleplayer, «Allow Cheats»[JE only] or «Activate Cheats»[BE only] in options must be enabled. In multiplayer, Gui can be opened only by operators in Creative mode, and in Java Edition op-permission-level
in the server.properties file must be set to 2
or above (default is 4).
In Java Edition to enter command or modify the command block, enable-command-block
in the server.properties file must be set to true
(default is false
).
Bedrock edition command block GUI
In Java Edition, opening the GUI in singleplayer pauses the game.
- Console Command[JE only]/Command Input[BE only]
- Commands can be entered in the top text pane. The text limit for commands in a command block is 32,500 characters, but the text pane can show only a small portion of this amount at a time.
- Commands in a command block do not need to be prefixed with the forward-slash (
/
) as they do in the chat window, but doing so still works.
- Press Tab ↹ to complete words or cycle through options.
- In Bedrock Edition, below the console command text pane are some reminder tips about how to use target selectors.
- Previous Output
- The bottom text pane displays the output message (success or failure) of the last executed command (it is blank[JE only] or «
-
«[BE only] initially). Its text is not editable.
- A button to the right of the Previous Output text pane[JE only] or the left of the «Previous Output»[BE only] specifies whether the last output should be stored and displayed. It is
O
[JE only]/enabled[BE only] when the output text should be stored andX
[JE only]/disabled[BE only] when the output text should not be stored. For worlds with many command blocks, especially command blocks running on fast clocks, not storing the output text can reduce memory and storage requirements.
- If gamerule
sendCommandFeedback
is true (the default), default toO
[JE only]/enabled[BE only]. Otherwise defaults toX
[JE only]/disabled[BE only].
- Block Type
Left: «Impulse» block type.
Middle: «Chain» block type.
Right: «Repeating» block type.
Top: «Unconditional» mode.
Bottom: «Conditional» mode.
- Click the «Impulse/Chain/Repeat»[JE only]/»Block Type»[BE only] button to change the command block’s type. The default state is «Impulse», but non-default command blocks can be obtained and placed. The command block also changes color when changing its command block type:
-
- «Impulse» command blocks are orange. They execute once every time they are activated.
- «Chain» command blocks are green. They execute once every time they are triggered if they have been activated.
- «Repeat» command blocks are purple. They execute their commands once every one game tick (or more[BE only]) as long as they are activated.
- Condition
- Click the «Conditional/Unconditional»[JE only]/»Condition»[BE only] button to change the command block’s conditional behavior:
- «Conditional»: A command block in conditional mode executes its command only when the command block behind it has executed successfully («Success count» is greater than 0).
- «Unconditional» (default): A command block in unconditional mode executes its command even if there’s a command block behind it that didn’t execute its command successfully.
- «Behind it» in the sense of opposite to the direction the command block is facing, regardless of chain direction or even if chaining is occurring.
- Redstone
- Click the «Always Active/Needs Redstone»[JE only]/»Redstone»[BE only] button to change the command block’s activation requirements:
- «Needs Redstone» (the default for impulse and repeat command blocks): A command block in the «Needs Redstone» setting can be activated only with redstone.
- «Always Active» (the default for chain command blocks): The command block is activated when set to «Always Active». Then it is always active even without redstone activation.
- Execute on First Tick[BE only]
- Specifies whether a repeat command block executes its command as soon as it is activated. If it’s disabled, executes the first time after the delay from the time when it is activated.
- Delay in Ticks[BE only]
- For impulse or chain command block, specifies how many game ticks it delays before executing a command after it is activated or triggered.
- For repeat command block, specifies how many game ticks it delays to execute again.
- Note that for impulse or repeat command block, 0 and 1 work the same; the game takes 0 as 1. However, For chain command block, 0 and 1 are different.
- Hover Note[BE only]
- Specifies the name of the command block, which can be seen when you point to the block. It is also used for message commands. If the command block had been named in an anvil before placement, that name is used as well. If it is empty, defaults to
!
.
- Done
- In Java Edition, click the «Done» button or ↵ Enter to save the command and leave the command block GUI.
- In Bedrock Edition, close the GUI to save the command and changes.
- Cancel
- Click the «Cancel» button or Esc[JE only]to leave the command block GUI without saving any changes.
Activation
Command blocks are redstone mechanisms and can be activated by:
- An adjacent active power component: for example, a lever, a block of redstone, a daylight sensor, a button etc.
- An adjacent powered block (for example, an opaque block with an active redstone torch under it)
- A powered redstone comparator or redstone repeater facing the mechanism component
- Powered redstone dust configured to point at the command block (or on top of it) or directionless; a command block is not activated by adjacent powered redstone dust that is configured to point away from it.
A command block can also be activated by setting it to «Always Active» mode.
When activated, a command block executes its command, depending on the command block’s type:
- An impulse command block executes its command once.
- A chain command block does not execute its command until it is triggered.
- A repeat command block executes its command once every one game tick (or more[BE only]) until no longer activated.
Execution
An impulse command block, when it is activated, checks whether the command block behind it has executed successfully (if in conditional mode). After the delay of 1 game tick (or more[BE only]), if the condition is met before the delay (if in «Conditional» mode), it executes its command once and triggers the chain command block it is pointing to.
A repeat command block, when it is activated, after 1 game tick (always 1 no matter how many «Delay in Ticks» is), checks whether the command block behind it has executed successfully (if in conditional mode). If the condition is met, and if «Execute on First Tick» is enabled in Bedrock Edition, it executes its command once and triggers the chain command block it is pointing to. If it is still activated, it then checks, executes, and triggers the chain command block again after 1 game tick (or more[BE only]).
When executing a command, it also updates its success count: If in «Conditional» mode, if the command block behind it didn’t execute successfully, it sets its success count to 0. Otherwise, it sets it to the success count of the command.
Also:
- When an impulse or repeat command block in «Needs Redstone» mode with a command is placed or is cloned by a command to a powered location, the new command block executes its command only if it hasn’t been activated with redstone. In Java Edition, it also needs a block update to execute its command.
- When an impulse or repeat command block in «Always Active» mode with a command is placed or is cloned by a command to a powered location, the new command block executes its command only if it hasn’t been activated with redstone.
- When an impulse or chain command block is set to «Repeat», if it has been activated, checks whether the command block behind it has executed successfully (if in conditional mode). After 1 game tick (always 1 no matter how many «Delay in Ticks» is), if the condition is met, it executes its command once and triggers the chain command block it is pointing to. Then it checks, executes, and triggers the chain command block again after 1 game tick (or more[BE only]).
Trigger and chaining
If any command block having executed its command (whether successfully or unsuccessfully) faces a chain command block, it triggers the chain command block to also attempt execution.
When a chain command block is triggered,
- If it has been activated,
- It checks whether it is in «Conditional» mode and the command block behind it hasn’t executed successfully (Behind in the sense of the direction it is facing, not in the sense of which command block chained to it),
- If true, it triggers another chain command block it is facing, without executing the command.
- If false, it checks whether it has been already executed in this game tick. If false, it executes the command and triggers another chain command block it is facing. If true, it does nothing. That means that chained execution cannot be passed to a command block that has already executed in that game tick (loops execute only once).
- It checks whether it is in «Conditional» mode and the command block behind it hasn’t executed successfully (Behind in the sense of the direction it is facing, not in the sense of which command block chained to it),
- If it has not been activated, it triggers the chain command block it is facing to attempt execution.
Chained command blocks execute simultaneously in the same game tick in the order they are chained.
In Bedrock Edition, it can also delay before executing commands if «Delay in Ticks» is not 0:
- When it is triggered,
- If it has been activated, the chain command block checks whether the command block behind it has executed successfully (if in conditional mode), then it delays.
- After a delay, if the condition is met before the delay (if in «Conditional» mode), it executes its command once and triggers the chain command block it is pointing to no matter whether the condition met.
- If it has not been activated, it triggers (without delay) the chain command block it is facing to attempt execution.
- If it has been activated, the chain command block checks whether the command block behind it has executed successfully (if in conditional mode), then it delays.
In Java Edition, it can execute multiple times in the same game tick if «UpdateLastExecution» is set to false. In this case, it does not check whether it has already executed in this game tick.
If the chain command block has been activated when triggered, it also updates its success count: If in «Conditional» mode, if the command block behind it didn’t execute successfully, it sets its success count to 0. Otherwise, it sets it to the success count of the command.
Output
When activated, a command block can produce multiple types of output:
Success count
- A command block can power a redstone comparator facing away from it (possibly separated by a block) with signal strength specific to the success count. Success count is an integer between 0 to 2,147,483,647 (inclusive).
- The signal strength always reflects the last command executed, even after the command block is deactivated.
- In Java Edition, success count is usually 0 or 1, except for
/function
and/execute
.
- In Bedrock Edition, success count is an integer related to the command (e.g., the number of players affected by the command, the number of blocks that were altered, the value returned by the command, etc.)
- In Java Edition, leaving the command block GUI by clicking «Done» or pressing ↵ Enter resets the success count to 0, regardless of whether changes were made in the GUI. In Bedrock Edition, leaving the GUI with changes resets the success count to 0.
Message
- The output message describes the success or failure of the executed command, and may be written to multiple destinations:
- Previous Output: The output message is always written to the «Previous Output» text pane of the command block GUI.
- Chat: The output message is written to the chat text in singleplayer mode, or broadcast to all other ops in multiplayer mode, unless it has been suppressed with
/gamerule commandBlockOutput false
. Some commands may write additional text to the chat as their normal function, which won’t be suppressed (for example, the/say
command writes a message to the chat of all players), separate from the output message. Chat messages that would usually be prefaced by a player’s name (such as from the/me
,/say
and/tell
commands) use@
[Java Edition only] /!
[Bedrock Edition only] as the player name. If the command block had been named in an anvil before placement, that name is used instead. In Bedrock Edition, it can also modified in the GUI.
- Logs: The output message is written to multiplayer server logs unless it has been suppressed with
/gamerule logAdminCommands false
.
Notes
Command blocks execute commands with OP level 2. The following commands cannot be used in a command block: /ban
, /banlist
, /ban-ip
, /debug
, /deop
, /kick
[JE only], /op
, /pardon
, /pardon-ip
, /publish
, /reload
[BE only], /save-all
, /save-off
, /save-on
, /stop
, and /whitelist
(i.e., /debug
, /publish
, and all of the multiplayer-only commands except /list
).
Easter eggs
Running «Searge» (case insensitive) as the command in the command block without a preceding «/
» will set the previous output to «#itzlipofutzli». Its success count is 1.
Piston interactivity
Command blocks cannot be pushed by pistons. They also cannot be pushed or pulled by sticky pistons.
Sounds
Java Edition:
Sound | Subtitles | Source | Description | Resource location | Translation key | Volume | Pitch | Attenuation distance |
---|---|---|---|---|---|---|---|---|
Block broken | Blocks | Once the block has broken | block.metal.break |
subtitles.block.generic.break |
1.0 | 1.2 | 16 | |
Block placed | Blocks | When the block is placed | block.metal.place |
subtitles.block.generic.place |
1.0 | 1.2 | 16 | |
Block breaking | Blocks | While the block is in the process of being broken | block.metal.hit |
subtitles.block.generic.hit |
0.25 | 0.75 | 16 | |
None[sound 1] | Entity-Dependent | Falling on the block with fall damage | block.metal.fall |
None[sound 1] | 0.5 | 1.25 | 16 | |
Footsteps | Entity-Dependent | Walking on the block | block.metal.step |
subtitles.block.generic.footsteps |
0.15 | 1.5 | 16 |
- ↑ a b MC-177082
Bedrock Edition:
Sound | Source | Description | Resource location | Volume | Pitch |
---|---|---|---|---|---|
Blocks | Once the block has broken | dig.stone |
1.0 | 1.1-1.2 | |
Blocks | When the block is placed | use.stone |
1.0 | 1.2-1.25 | |
Blocks | While the block is in the process of being broken | hit.stone |
0.3 | 0.75 | |
Players | Falling on the block with fall damage | fall.stone |
0.4 | 1.0 | |
Players | Walking on the block | step.stone |
0.35 | 1.0 | |
Players | Jumping from the block | jump.stone |
0.12 | 1.0 | |
Players | Falling on the block without fall damage | land.stone |
0.22 | 1.0 |
Data values
ID
Java Edition:
Name | Identifier | Form | Block tags | Translation key |
---|---|---|---|---|
Command Block | command_block |
Block & Item | dragon_immune wither_immune |
block.minecraft.command_block |
Chain Command Block | chain_command_block |
Block & Item | dragon_immune wither_immune |
block.minecraft.chain_command_block |
Repeating Command Block | repeating_command_block |
Block & Item | dragon_immune wither_immune |
block.minecraft.repeating_command_block |
Name | Identifier |
---|---|
Block entity | command_block |
Bedrock Edition:
Name | Identifier | Numeric ID | Form | Item ID[i 1] | Translation key |
---|---|---|---|---|---|
Command Block | command_block |
137 |
Block & Giveable Item[i 2] | Identical[i 3] | tile.command_block.name |
Chain Command Block | chain_command_block |
189 |
Block & Giveable Item[i 2] | Identical[i 3] | tile.chain_command_block.name |
Repeating Command Block | repeating_command_block |
188 |
Block & Giveable Item[i 2] | Identical[i 3] | tile.repeating_command_block.name |
- ↑ ID of block’s direct item form, which is used in savegame files and addons.
- ↑ a b c Available with
/give
command. - ↑ a b c The block’s direct item form has the same id with the block.
Name | Savegame ID |
---|---|
Block entity | CommandBlock |
Block states
Java Edition:
Name | Default value | Allowed values | Description |
---|---|---|---|
conditional | false |
false true |
True if the command block is in conditional mode. |
facing | north |
down east north south up west |
The direction the command block is pointing. |
Bedrock Edition:
Name | Metadata Bits | Default value | Allowed values | Values for Metadata Bits |
Description |
---|---|---|---|---|---|
conditional_bit | 0x8 |
false |
false true |
0 1 |
True if the command block is in conditional mode. |
facing_direction | 0x1 0x2 0x4 |
0 |
0 1 2 3 4 5 |
0 1 2 3 4 5 |
The direction the command block is pointing.
|
Block data
A command block has a block entity associated with it that holds additional data about the block.
Java Edition:
- Block entity data
- auto: 1 or 0 (true/false) — Allows to activate the command without the requirement of a redstone signal.
- Command: The command to issue to the server.
- conditionMet: 1 or 0 (true/false) — Indicates whether a conditional command block had its condition met when last activated. True if not a conditional command block.
- CustomName: Optional. The name JSON text component of this command block, replacing the usual ‘@’ when using commands such as
/say
and/tell
. - LastExecution: stores the tick a chain command block was last executed in.
- LastOutput: The last line of output generated by the command block. Still stored even if the game rule
commandBlockOutput
isfalse
. Appears in the GUI of the block when right-clicked, and includes a timestamp of when the output was produced. - powered: 1 or 0 (true/false) — States whether or not the command block is powered by redstone or not.
- SuccessCount: Represents the strength of the analog signal output by redstone comparators attached to this command block.
- TrackOutput: 1 or 0 (true/false) — Determines whether the LastOutput is stored. Can be toggled in the GUI by clicking a button near the «Previous Output» textbox. Caption on the button indicates current state: «O» if true, «X» if false.
- UpdateLastExecution: 1 or 0 (true/false) — Defaults to true. If set to false, loops can be created where the same command block can run multiple times in one tick.
Bedrock Edition:
- See Bedrock Edition level format/Block entity format.
History
Java Edition | |||||
---|---|---|---|---|---|
July 27, 2012 | Jeb began tweeting of a new block he had created to start expanding Adventure mode. He began posting pictures, ideas and hints of what the block can do. | ||||
July 31, 2012 | During Notch’s AMA on Reddit, he hinted the block may be in Java Edition 1.4. | ||||
1.4.2 | 12w32a | Added command blocks. | |||
12w38a | Added the game rule commandBlockOutput . |
||||
1.5 | 13w03a | Command block success can now power a redstone comparator. | |||
13w04a | Command blocks renamed with an anvil now use their name instead of @ in the chat. | ||||
13w10a | Pressing Esc in a command block will exit its GUI. | ||||
1.6.1 | 13w19a | Command blocks are no longer mineable in Survival. | |||
Command blocks are no longer damaged by explosions, except by blue wither skulls. | |||||
1.7.2 | 13w37a | A bar that shows the previous output of command blocks has been added. | |||
The character limit when inserting a command in a command block has been increased from 256 to 16,369. Using a third-party editor allows the player to reach 32,767 characters. | |||||
1.8 | 14w07a | Dispensers now place command blocks, instead of shooting them out. | |||
14w20a | The in-game character limit of 16,369 has been removed, allowing access to the full 32,767 characters. | ||||
14w27a | Added CommandStats NBT tag to command blocks. | ||||
1.8.6 | Dispensers no longer place command blocks.[1] | ||||
1.9 | 15w33a | The character limit for command blocks is now 32,500 instead of 32,767. | |||
15w34a | Added the chain command block and the repeating command block. | ||||
Added block facing for command blocks. | |||||
The texture of command blocks has been changed. | |||||
15w34b | Added Conditional mode within command blocks. | ||||
Added tab completion support within command blocks. | |||||
15w35a | The textures of all three command blocks have been changed. | ||||
When command blocks are set to conditional, the back of the arrow texture is now curved. | |||||
Added Always active and needs redstone options for command blocks. | |||||
Added auto NBT tag to control redstone options within command blocks. |
|||||
15w36a | Players are now unable to use commands, such as /give , within command blocks.
|
||||
Players, who are unable to use commands, can no longer place command blocks. | |||||
15w36d | Each command block type now appears with different colors on maps. | ||||
16w02a | Running /help in a command block now randomly uses one of various different humorous phrases as the previous output. |
||||
16w04a | Running «Searge» as the command in the command block without a preceding «/ » now sets the previous output to «#itzlipofutzli». |
||||
1.11 | 16w32a | The block entity ID has been changed from Control to command_block . |
|||
1.12 | 17w16a | Chains of command blocks no longer schedule their commands to be run in the next tick. Instead, they now execute all in the same tick they are read. This allows later blocks in a chain to be modified via earlier blocks, allowing techniques like branching and looping, all in the same tick. | |||
17w16b | Added the game rule maxCommandChainLength to control the max length of a command block chain. |
||||
17w17a | Added UpdateLastExecution and LastExecution NBT tags, which control the tracking of which tick a chain command block was last executed in. |
||||
pre6 | Tab-completing command names in command blocks no longer add a / prefix. |
||||
1.13 | 17w47a | Prior to The Flattening, the numeral IDs for the command block, repeating command block, and chain command block were 137, 210, and 211, respectively. | |||
pre1 | The player can now tab-complete in command blocks again. | ||||
1.14 | 18w43a | The textures of command blocks have been changed. | |||
18w47b | The textures of impulse and repeating command blocks have been changed. | ||||
1.19.3 | 22w44a | Command blocks are now available in the creative inventory, but only if cheats are enabled. | |||
22w45a | Moved command blocks behind the Operator Utilities tab in the creative inventory. The tab is only available if cheats are enabled and the «Operator Items Tab» option in the controls menu is turned on. | ||||
Pocket Edition | |||||
1.0.5 | alpha 1.0.5.0 | Added all types of command blocks. | |||
Bedrock Edition | |||||
1.8.0 | beta 1.8.0.8 | Command blocks now have a default name of ! instead of @ . |
|||
1.10.0 | beta 1.10.0.3 | The textures of command blocks have been changed. | |||
1.12.0 | beta 1.12.0.2 | Tab-complete has been added to command blocks. | |||
Added a delay option to command blocks, which allows a delay to be added to a redstone tick delay field. | |||||
Legacy Console Edition | |||||
TU19 | CU7 | 1.12 | Patch 1 | Added command blocks. | |
Command blocks do not have any functionality and can be obtained only with mods. |
Issues
Issues relating to «Command Block» are maintained on the bug tracker. Report issues there.
Gallery
-
The first image released by Mojang of the command block.
-
The second image released by Mojang showing the block giving glass to the player.
References
- ↑ https://bugs.mojang.com/browse/MC-80671?focusedCommentId=228546&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-228546
External Links
- Block of the Week: Command Block – Minecraft.net on April 27, 2018
Командный блок используется для записи команд. Выполнение команды начинается при получении сигнала красной пыли.
Командный блок выдает только администратор сервера или игрок в одиночном режиме.
- Синонимы: Command block
- ID: command_block
- Версии Майнкрафт:1.17 / 1.16.5 / 1.16.4 / 1.16.3 / 1.16.2 / 1.16.1 / 1.16
Как сделать командный блок
Здесь указано, как сделать командный блок в Майнкрафте. В рецепте крафта указываются необходимые ингредиенты и их расположение в Minecraft.
Нельзя сделать
К сожалению, командный блок нельзя сделать в инвентаре или на верстаке в игре Майнкрафт.
Командный блок можно получить, используя команды в креативном режиме.
Вверх
Команда получения командного блока
Здесь указана команда, которая позволяет получить командный блок в Майнкрафте, то есть как в Minecraft создать командный блок.
Командный блок можно призвать с помощью команды в креативном режиме.. Для этого нужно:
- открыть чат (клавиша «T» английская)
- написать команду
/give @p minecraft:command_block
- нажать клавишу «ENTER» (ВВОД)
Также можно указать количество и кому командный блок будут выдаваться:
-
/give @p minecraft:command_block 10
получить 10 командных блоков -
/give MinecraftMax minecraft:command_block
командный блок будет передан игроку с ником MinecraftMax
Команду можно прописать в командный блок, чтобы она исполнялась при получении сигнала красного камня.
Вверх
Загрузить PDF
Загрузить PDF
Из этой статьи вы узнаете, как в Minecarft создать командный блок (блок, который выполняет определенные команды). Это можно сделать в компьютерной и мобильной версиях игры. Чтобы создать действующий командный блок, нужно перейти в творческий режим и включить поддержку чит-кодов. Командный блок нельзя создать в консольной версии Minecraft.
-
1
Запустите Minecraft. Для этого дважды щелкните по значку этой игры. Затем нажмите «Play», «Играть», «Вход» или аналогичную кнопку (если будет предложено).
-
2
Щелкните по Одиночная игра. Эта кнопка находится в верхней части главного окна Minecraft.
- Также можно выбрать «Сетевая игра», но в этом случае сначала нужно настроить многопользовательскую игру на своем собственном сервере.
-
3
Нажмите Создать новый мир. Вы найдете эту опцию в нижней правой части окна.
- Если вы уже создали мир в творческом режиме и активировали в нем поддержку чит-кодов, щелкните по этому миру, а затем нажмите «Играть в выбранном мире» и перейдите к шагу «Нажмите /».
-
4
Введите название мира. Сделайте это в строке «Название мира».
-
5
Дважды щелкните по Режим игры Выживание. В строке сначала отобразится «Режим игры: Хардкор», а затем — «Режим игры: Творческий». Сделайте так, потому что пользоваться командными блоками можно только в творческом режиме.
- Командные блоки можно встретить и в режиме выживания, но ими нельзя пользоваться.
-
6
Нажмите Настройка мира. Эта опция находится в нижней части окна.
-
7
Щелкните по Использование читов Выкл. В строке отобразится «Использование читов: Вкл», то есть теперь поддержка чит-кодов включена.
- Если в строке отображается «Использование читов: Вкл», поддержка чит-кодов уже активирована.
-
8
Нажмите Создать новый мир. Эта кнопка находится в нижнем левом углу окна.
-
9
Нажмите /. Символ «/» можно найти на клавиатуре. В нижней части окна Minecraft откроется консоль.
-
10
Введите give player command_block в консоли. Вместо «player» введите имя своего персонажа.
- Например, если имя персонажа «potatoSkin», введите give potatoSkin command_block.
-
11
Нажмите ↵ Enter. Команда будет выполнена, а в руке персонажа появится командный блок.
-
12
Поставьте командный блок на землю. Щелкните правой кнопкой мыши по земле, когда персонаж держит командный блок.
-
13
Щелкните правой кнопкой мыши по командному блоку. Откроется окно командного блока.
-
14
Введите команду. Введите команду, которую выполнит командный блок, в строке в верхней части окна.
-
15
Измените параметры командного блока. Для этого измените следующие параметры:
- «Импульсный»: блок выполнит команду один раз, когда вы щелкните по нему правой кнопкой мыши. Нажмите «Импульсный», чтобы переключиться на «Цепной», чтобы блок запускался только тогда, когда запустится предыдущий блок. Нажмите «Цепной», чтобы переключиться на «Цикличный», чтобы блок выполнял команду 20 раз в секунду.
- «Безусловный»: дополнительный условий для работы блока нет. Нажмите «Безусловный», чтобы переключиться на «Условный», чтобы блок запускался только после того, как предыдущий блок выполнит команду.
- «Нужен сигнал»: блок будет запускаться только при контакте с Красным камнем. Нажмите «Нужен сигнал», чтобы перейти к «Всегда активен», чтобы блок запускался вне зависимости от Красного камня.
-
16
Щелкните по Готово. Теперь вы настроили командный блок.
- Если вы выбрали опцию «Нужен сигнал», подведите к командному блоку красную пыль, чтобы запустить командный блок.
Реклама
-
1
Запустите приложение Minecraft PE. Нажмите на значок в виде блока земли с травой.
-
2
Коснитесь Играть. Эта кнопка находится посередине экрана.
-
3
Нажмите Создать новый. Эта опция находится в верхней части экрана.
- Если вы уже создали мир в творческом режиме и активировали в нем поддержку чит-кодов, щелкните по этому миру, а затем перейдите к шагу «Введите команду».
-
4
Коснитесь Создать игровой мир. Эта кнопка расположена в верхней части экрана.
-
5
Введите название мира. Коснитесь поля «Название мира» и введите название мира.
-
6
В меню «Режим игры по умолчанию» выберите «Творческий». По умолчанию в этом меню выбран режим «Выживание».
-
7
Нажмите Продолжить, когда появится запрос. Теперь в новом мире можно играть в творческом режиме и пользоваться чит-кодами.
-
8
Коснитесь Создать. Эта кнопка находится в левой части страницы. Будет создан новый мир.
-
9
Щелкните по значку «Чат». Этот значок в виде речевого облака расположен в верхней части экрана (слева от значка Пауза).
-
10
Введите команду для получения командного блока. Введите /give player command_block. Вместо «player» введите имя своего персонажа.
-
11
Нажмите на направленную вправо стрелку. Она находится в правой части консоли. Команда будет выполнена, а командный блок появится в инвентаре персонажа.
-
12
Возьмите командный блок. Нажмите «⋯» в нижней правой части экрана, коснитесь вкладки со значком в виде ящика в левой части, а затем коснитесь значка командного блока.
-
13
Поставьте командный блок на землю. Для этого коснитесь земли.
-
14
Нажмите на командный блок. Откроется окно командного блока.
-
15
Измените параметры командного блока. Измените следующие параметры в левой части экрана (если хотите):
- «Тип блока»: оставьте «Импульс», чтобы блок выполнил команду, когда вы коснетесь его. Нажмите «Импульс» и выберите «Цепь», чтобы блок запускался только тогда, когда запустится предыдущий блок. Нажмите «Импульс» и выберите «Цикл», чтобы блок выполнял команду 20 раз в секунду.
- «Условие»: оставьте «Без условий», чтобы блок работал независимо от других блоков. Нажмите «Без условий» и выберите «При условии», чтобы блок запускался только после того, как предыдущий блок выполнит команду.
- «Красный камень»: оставьте «Необходим красный камень», чтобы блок запускался только при контакте с Красным камнем. Нажмите «Необходим красный камень» и выберите «Работает всегда», чтобы блок запускался вне зависимости от Красного камня.
-
16
Введите команду. Нажмите «+» в верхней правой части окна, введите команду и нажмите «-» в верхнем правом углу экрана.
-
17
Закройте окно командного блока. Нажмите «x» в правом верхнем углу экрана. Теперь вы настроили командный блок.
- Если вы выбрали опцию «Необходим красный камень», подведите к командному блоку красную пыль, чтобы запустить командный блок.
Реклама
Советы
- Параметры командного блока можно изменить в любой момент.
Реклама
Предупреждения
- Командный блок нельзя получить в консольной версии Minecraft.
Реклама
Об этой статье
Эту страницу просматривали 759 375 раз.
Была ли эта статья полезной?
Download Article
Download Article
Commands (also known as cheats) allow players to change every aspect of a Minecraft world, or even other players in it. Each command block is an in-game item that stores a specific command. Whenever the block activates, that command takes effect. This allows you to build fun toys, convenient tools, or even complex, custom adventure maps full of triggered events.
-
1
Open Minecraft on a PC or Mac. Only the computer edition of Minecraft has command blocks. They are not yet available for Minecraft Pocket Edition or Minecraft for gaming consoles.
-
2
Enter a world where you have console access. Command blocks are in-game items that give access to the Minecraft console. They are powerful tools that let you reshape the whole game — but because of this, they are only available in certain circumstances:
- On a multiplayer server, only the server operators can use command blocks. You’ll need to ask an operator to promote you, or host your own server.
- In a single-player world, you’ll need to enable cheats if they weren’t enabled at world creation. Open the menu and click Open to LAN, check the «Allow Cheats» box, and click Start LAN world. This will only last one play session, but you can repeat it each time you want to add more command blocks.
Advertisement
-
3
Switch to creative mode. Now that you have console access, you can switch to creative mode. This is the only mode that lets you place and program command blocks. Use the following command to accomplish this:
- Hit T to open the console (the chat bar), or press / to open it and automatically enter / to the line you are typing.
- Type /gamemode c and hit Enter to enter creative mode.
- Once you’re done setting up command blocks, type /gamemode s for survival mode or /gamemode a for adventure mode.
-
4
Create command blocks. Open the console again with T and type this command: /give (yourusername) minecraft:command_block 64 . Instead of (yourusername), type in your full Minecraft username, without parentheses.
- Your username is case sensitive.
- If nothing happens, you may need to update minecraft to at least version 1.4. Update to the latest version to get access to all commands.
- You can replace the «64» with any number to receive that many blocks. 64 makes a full stack of command blocks.
Advertisement
-
1
Place a command block. Check your inventory and look for the command blocks you just created. The icon is a brown, patterned box with grey control panels on each side. Move the command blocks to your quick slot and place one on the ground, just as you would any item.
-
2
Open the command block interface. Walk up to the command block and right-click to open it, as you would a chest. A window should pop up with a text box.
- If nothing happens, command blocks might be disabled on your multiplayer server. Someone with access to the server.properties file will need to open that file and set enable-command-block to «true» and op-permission-level to «2» or higher.
-
3
Enter a command. You can enter just about any command in the command block’s text field, then press Done to save it in the block. There’s a long list of commands included below, but try summon Sheep for your first experiment.
- To learn more commands, open the regular console (not the command block) and type /help.
- Unlike the regular console, a command block’s text box does not need to start with the / symbol.
-
4
Activate the block with redstone. Connect a trail of redstone dust to the command block, and place a pressure plate on top of the redstone. Walk over the pressure plate to activate the redstone, and a sheep should appear next to the block. This will happen whenever any player or mob activates the redstone.
- This works just like a regular redstone activation. You can replace the pressure plate with a button, lever, or other activation method of your choice. You can even place the button directly on the command block.
- Anyone can use the command block once it’s set up, but only players with the right permissions can change the command.
-
5
Learn the special syntax. For the most part, command block text works the same as the regular console. If you aren’t familiar with the console yet, check out the example section below to get started. If you already know how to use console commands, these are the only extra terms you need to learn:
- @p targets the player nearest to the command block, no matter how far away she is.
- @r targets a random player, anywhere on the server.
- @a targets every single player on the server, including yourself.
- @e targets every «entity» on the server. This includes practically anything that isn’t a block, including players, objects, enemies, and animals. Be careful messing with this one.
- You can use these terms wherever you would use a player name or entity name (although these terms still work fine).
-
6
Modify the syntax for more control (optional). You can create extra-specific commands by adding modifiers after @p, @r, @a, or @e. These use the at [(argument)=(value)]. There are many different arguments and values available. You can look up the full list online, but here are some examples to get you started:
- A command that includes @r[type=Sheep] will affect a random sheep.
- @e[m=c] affects everyone in creative mode. The «m» argument stands for mode, and «c» stands for creative.
- Use the ! symbol to make the opposite value. For example, @a[team=!Commando] will affect every player not on team Commando. (Teams only exist on special player-made maps.)
-
7
Use the Tab key for help. If you know a command, but aren’t sure what you can use it for, press Tab and the game will fill it out for you. Press Tab a second time to scroll through a list of options.
- For example, go back to your sheep-summoning block and delete the word «Sheep.» Press Tab to cycle through a list of possible entities to summon.
Advertisement
-
1
Make a teleportation box. Save the command tp @p x y z into a command block. Instead of x, y, and z, enter the x-, y-, and z-coordinates of the location you’d like to teleport (for example, /tp @p 0 64 0). When anyone activates this box, the player nearest to the box will vanish and reappear at those coordinates.
- Press F3 to display coordinates.
- Just like any command, you can replace the «@p» with another term. If you type your username, you’ll always be the one teleported, even if someone else activates the block. If you use @r, a random player on the server will be teleported.
-
2
Spawn objects or blocks. Assuming you’re using Minecraft 1.7 or later, you can make command blocks to summon any entity or block. Here are some examples:
- A command block with summon Boat stored will add a new boat next to the block every time the block becomes activated. The people of your server will never need to wait for a ferry again.
- To spawn a block instead of an entity, use the setblock command instead of the summon command. setblock minecraft:water 50 70 100 turns the block at the coordinates 50-70-100 into water. If there was already a block there, it disappears.
-
3
Destroy objects or players. The kill command will permanently destroy an entity. This one is dangerous to use, since a typo could end up destroying the wrong thing (or even your entire world if you use @e). kill @r[type=Painting,r=50] destroys a random painting within a 50 block radius of the command block.
-
4
Control time and weather. time set day or time set 0 will set the level of sunlight to the specified amount. Try different values instead of 0 to make it any time you like. Once you’re tired of ruling over perpetual sunshine, make a block with toggle downfall or weather rain to start the rain.
-
5
Try out even more commands. There are hundreds of commands, which you can find by using /help or searching Minecraft websites. Here are a few more to explore:
- say (message)
- give (player) (item) (number of that item)
- effect (player) (potion effect)
- gamerule
- testforblock
Advertisement
Add New Question
-
Question
What do I do if the command summoned a zombie, but didn’t put armor on it?
You need to specify if the zombie has armor:
(/summon Zombie) will tell minecraft to summon a regular zombie with nothing extra, like weapons or armor. To summon a zombie with armor, do :
/summon Zombie ~ ~ ~ {Equipment:[{id:minecraft:leather_boots},{id:minecraft:leather_leggings},{id:minecraft:leather_chestplate} {id:minecraft:leather_helmet}]}. -
Question
How do I spawn animals?
Enter summon, and then press tab to select what to summon. You can summon anything from every single mob to a lightning bolt.
-
Question
How do I destroy blocks with command blocks?
The «setblock» command places blocks, including air»blocks», so «setblock minecraft:air [x] [y] [z]» (without the quotes) should remove a block, or actually replace by air.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
-
In the regular console, type /help for a list of commands. Type /help (command name) to learn about a specific command. You can also find more information at Minecraft wikis and community websites.
-
To turn off the chat notifications for a successful command, open the regular console and enter /gamerule commandBlockOutput false.
-
Nothing happens when the signal to a command block turns off. The command block will trigger again once the signal returns.
Show More Tips
Thanks for submitting a tip for review!
Advertisement
-
A redstone signal must be boosted by a redstone repeater if it travels more than 15 blocks.
-
You must click Done to save a command block. Closing the window by pressing Esc will not save your command.
Advertisement
About This Article
Article SummaryX
1. Enter a world in which you have console access.
2. Switch to creative mode.
3. Type «/give (yourusername) minecraft:command_block (number of blocks)» at the console.
4. Place and open a command block.
5. Run a command and click Done.
Did this summary help you?
Thanks to all authors for creating a page that has been read 189,913 times.