> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.ggservers.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to Enable And Use Command Blocks

![](https://storage.crisp.chat/users/helpdesk/website/65cb5bc40044bc00/80823c68-8e4e-4ed3-8f3d-ee5a2b_3ttbkk.png)

This article will show you how to enable and use command blocks on your Minecraft server.

||| For this tutorial, you need to be an OP. If you don’t know how to add yourself as an OP, please follow our guide: [How to: OP Yourself on Your Minecraft Server](/en-us/article/how-to-op-yourself-on-your-minecraft-server-1l4zakc/).

Also, please note that to be able to use command blocks you need to be in creative, which can be done by using the following command:  
`/gamemode creative`  
---

# ❓ What Are Command Blocks ❓

Command blocks are actual in-game blocks that can execute commands. So you can let a block run a command instead of yourself.

![](https://storage.crisp.chat/users/helpdesk/website/9d66da013dbbf000/a13cdb3c-3151-4856-9bde-192186_15d6hnk.png)

Note that command blocks can not be obtained through survival, but only in creative.  
---

# 🌲 Enabling Command Blocks In Your Server 🌲

Command Blocks are disabled by default. You can enable them in your server settings:

1. Log in to your Multicraft panel [here](https://mc.ggservers.com/site/login) and stop your server.  
---

2. Click on `Files`, then go to `Config Files`.

![](https://storage.crisp.chat/users/helpdesk/website/36e2d75765824a00/6102b7e6-33b3-4337-8bc5-d9d161_nnjc46.png)

---

3. Click on `Server Settings`.

![](https://storage.crisp.chat/users/helpdesk/website/92d4d73c6fb02800/8646f709-4012-498f-8c6e-70227d_1y50nrw.png)

---

4. Find `Enable Command Blocks` and set it to `Enabled`.

![](https://storage.crisp.chat/users/helpdesk/website/569efe91e4096000/8b80bd33-0f3a-41b7-a796-46f23e_knccyi.png)

---

5. Click on `Save` and start your server.

|| Make sure to click "Save" before leaving these settings.

You just enabled command blocks on your server.  
---

# 🤔 Getting a Command Block 🤔

There is no way to craft a command block, so you need to use the “give” command from Minecraft but depending on the version you run the command format can change.

* For version below 1.12 (ex. 1.8, 1.9, 1.10, 1.11, 1.12) you need enter the command to give someone a command block.

`/give <player_name> 137`

_Replace <player_name>` with the username of the player._  
---

* For version above 1.12 (ex. 1.13, 1.14, 1.15, 1.16) you need enter the command to give someone a command block.

`/give <player_name> minecraft:command_block`

_Replace <player_name>` with the username of the player._

|| You can also execute this command through your server console. Just remember that you don’t want to use the slash `/` in your Multicraft server console.

![](https://storage.crisp.chat/users/helpdesk/website/159eca0b8f913a00/58e50b29-94be-4eec-9d54-fb449b_1r4hkpg.png)

In this example, we used `@p` in Minecraft to give ourselves a command block.

![](https://storage.crisp.chat/users/helpdesk/website/53119852d9bea000/19d6c891-8df4-4d09-8b6e-01ac07_1lxe91q.gif)

Example: `/give @p minecraft:command_block`  
---

# 🔎 Using Target Selectors With Command Blocks 🔎

A target selector is a syntax used to target a player or entity in Minecraft.

- @p - Targets the nearest player.  
- @r - Targets a random player.  
- @a - Targets all players.  
- @e - Targets all entities.  
- @s - Target yourself.

### 💠 Commandhook Plugin

This plugin adds the possibility to use vanilla selectors in non-vanilla commands written in CommandBlock. More info regarding this plugin can be found [here](https://www.spigotmc.org/resources/commandhook.61415/).

||| [Here](https://help.ggservers.com/en-us/article/how-to-install-plugins-on-your-server-1yxw90a/) is our guide for installing plugins into your server.  
---

To install this plugin into your server you need to do the following:

1. Download the plugin from its official page [here](https://www.spigotmc.org/resources/commandhook.61415/).

![](https://storage.crisp.chat/users/helpdesk/website/ba33bb39ceb6d800/1_b69j3w.png)

---

2. Use Filezilla to upload the plugin to your server `plugins` folder.

![](https://storage.crisp.chat/users/helpdesk/website/ba33bb39ceb6d800/2_1y8jbll.png)

||| [Here](https://help.ggservers.com/en-us/article/how-to-connect-with-filezilla-yl0q5r/) is our guide for using Filezilla.  
---

3. Restart your server.

You just set up the Commandhook plugins into your server.  
---

| If you find any issues enabling or using command blocks on your server please contact us on live chat or via the [ticket system](https://help.ggservers.com/en-us/article/how-to-open-a-support-ticket-qjzuyd/).  
---

# ❕ Useful Links ❕

- [Vanilla Commands](https://help.ggservers.com/en-us/article/vanilla-commands-11xx8gv/)  
- [How To: Add an Icon to a Minecraft Server](https://help.ggservers.com/en-us/article/how-to-add-an-icon-to-a-minecraft-server-st8uif/)  
- [How to Use the Minecraft Whitelist](https://help.ggservers.com/en-us/article/how-to-use-the-minecraft-whitelist-1nw0h6e/)