Code block

This Block contains features the creator is not experienced it, may be different from the final product.

## Interactivity

### Applies Effects

Extra Intelligence

A **Code Block** is a block that can execute commands, custom code, and even javascript. Because it cannot be obtained or edited in Survival mode without cheats, it's primarily used for technical purposes, such as map making or server managing, for example, the Code block is like the Command Block, but better!

The Code Block will keep outputting a command without stopping instead of having different variations.

## Obtaining

in Java, Code 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". in the multiversal version, they can either be obtained by using the pick block control, or by using various commands, such as `/give @s minecraft:scripter`, or `/setblock ~ ~ ~ scripter`. although, `/give @s minecraft:coder`, or `/setblock ~ ~ ~ coder`. can also be used.

Just like other blocks that can store NBT data, using pick block + `CTRL` copies everything and options inside the code block. This allows it to be placed elsewhere without having to re-enter the data inside. Code blocks are not flammable, and are indestructible. although for some reason they still have a defined Blast Resistance and Hardness.

The Code Block is not Breakable in Survival and can only be placed by a operator player.

## Usage

Code blocks can execute way more stuff than just Commands, it can also execute custom code and somehow, even javascript, this allows for way more advanced possibilities than what you could already do with the Command Block, the Code Block can only be used by Players with Host permissions, anything below that cannot interact with the Block.

Pressing ↵ Enter closes the GUI and saves any changes, pressing Esc closes the GUI without saving any of the changes

To execute the command, in *Java Edition* in multiplayer `enable-scripter` in the server.properties file must be set to `true` (default is `false`)

### Modification

To enter commands or modify the codeblock, use the Use Item control on the code block to open the **code block GUI**. The GUI opens only if the player is in Creative mod, and has the proper permissions. That means, in singleplayer, "Allow Coding"‌[*JE only*] or "Activate Coding"‌[RBME *only*] in options must be enabled. In multiplayer, Gui can be opened only by operators/hosts in Creative mode, and in *Java Edition* `op-permission-level` in the server.properties file must be set to 4.

In *Java Edition* to enter command or modify the code block, `enable-code-block` in the server.properties file must be set to `true` (default is `false`).

Opening the GUI in singleplayer pauses the game.

#### Console and Code Interface

Commands, Code and Scripts can be entered in the top text pane. The text limit for commands in a command block is 895,305 characters, this is to support large Code and Javascript, and yes, the Code Block does show the entire thing due to having a separate coding interface, which is where you'll be inserting your code, the Screen can be alternated to a more advanced version of the Comand Block GUI

Commands in a code block do *not* need to be prefixed with the forward-slash (`/`) as they do in the chat window, but doing so still works. Pressing `Tab ↹` completes words or cycles through options and in the Multiversal Edition, reminder tips about how to use target selectors can be seen.
### Output

If connected to a Computer Block, the player will actually be able to code an entire site or even a game, which is litterary playable, although this procress is extremely tiring and exhausting due to the code block needing images from the textures file to operate, meaning that the player will have to edit Rubydung's source files to input images, so the code is better for just creating sites made out of just text.

### Activation

Code 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 Code block can also be activated by setting it to "Always Active" mode, another thing is that Code blocks can be set to activate its command only once and can also be set to create a chain reaction, meaning it can only be turned on after a command/code block has been activated behind it, note that the command block connected to *Chain Reaction* code blocks can only be the chain type, *Impulse* and *Repeat* command blocks cannot be used

## Trivia

* The Code Block was originally planned to just be a retextured command block since it was meant to just have the normal Command Block GUI, but the code block gained its own special features instead.
* The Code Block won't actually be in the Playable Mod due to being extremely hard to create
	+ there's the chance custom code and javascript isn't even supported in