Minecraft Wiki
Registreer
Advertisement
Vertalen
Deze pagina heeft vertaling nodig
Deze pagina bevat te veel woorden uit een andere taal.
Opdrachtblok
Voorwaardelijke opdrachtblokVoorwaardelijk kettingcommandoblokVoorwaardelijke herhalend commandoblok
OpdrachtblokKettingcommandoblokHerhalende commandoblok
Opdrachtblok

Type

Blok entiteit

Fysica

Nee

Transparant

Nee

Lichtsterkte

Nee

Explosieweerstand

18.000.000

Hardheid

-1

Gereedschap

?

Hernieuwbaar

Nee

Stapelbaar

Ja (64)

Brandbaar

Nee

Eerste verschijning

Zie § History

Laat vallen

Niets

Datawaarden

Zie § Data values

Jeb twitter Dit blok zal opdrachten kunnen uitvoeren op redstone signalen. Met redelijke opdrachten kunnen veel dingen gecodeerd worden
~ Jeb die de opdrachtblok aankondigde [1]

Een opdrachtblok is een blok dat opdrachten kan uitvoeren, aangezien het niet verkrijgbaar is in Survivalmodus zonder cheats wordt het dan ook vaak gebruikt op multiplayer servers en custom maps.

Verkrijgen[]

Opdrachtblokken kan je verkrijgen door blok selecteren of met opdrachten, zoals /give @p minecraft:command_block.

Zoals andere blokken kunnen ze NBT data opslaan, door ctrl + blok selecteren in te drukken slaat hij het commando en de opties op in het opdrachtblok. Dit zorgt ervoor dat je het overal kan plaatsen zonder dat je iets opnieuw moet instellen.

Opdrachtblokken zijn ook niet te verkrijgen in de Creative modus, kan niet ontgonnen worden in Survivalmodus of als je geen rechten hebt, kunnen niet branden, en hebben dezelfde explosieweerstand als bodemsteen. Opdrachtblokken kunnen niet verplaatst worden met een duwmachine.

Gebruik[]

Een opdrachtblok kan opdrachten uitvoeren als hij geactiveerd wordt door redstone (zie § Activatie). Het heeft altijd toestemming.

Een opdrachtblok heeft een georiënteerde "richtingtextuur" wat aangeeft welk ketting commandoblok wordt geactiveerd, en bij welke blok gecheckt wordt om te zien als een opdrachtblok in "Voorwaardelijke" mode kan worden uitgevoerd.

Modificatie[]

Opdrachtblok GUI

Opdrachtblok GUI.

Om een opdracht in een opdrachtblok te plaatsen of te veranderen, druk op gebruiken op een opdrachtblok voor de opdrachtblok GUI (Grafische gebruiker interface). De GUI gaat alleen open als de speler in Creative modus is, en hij toestemming heeft. In single player moeten cheats aanstaan om opdrachtblokken te wijzigen. In multiplayer kunnen opdrachtblokken alleen maar succesvol gewijzigd worden door de administrators in Creative modus, en om opdrachtblokken te laten werken moet je de volgende dingen zetten in het bestand server.properties:

  • enable-command-block moet gezet worden naar true
  • op-permission-level moet gezet worden naar 2 of erboven (standaard is 4)
Console Opdracht
Opdrachten kunnen worden ingevoerd in het bovenste invulvakje. Het tekenlimiet voor opdrachten in een opdrachtblok is 32.500 tekens, maar het kan maar kleine beetjes per keer laten zien. Druk Tab ↹ om woorden automatisch af te maken of er door te scrollen.
Opdrachten in een opdrachtblok hoeven niet met een slash (/) te beginnen zoals in de chat, maar als je ze gebruikt zal de opdracht nog steeds werken.
Onder het console opdracht invulvakje zijn er wat tips hoe je de target selectors gebruikt.
Vorige output
Het onderste vakje toont het ouput-bericht (succes of gefaald) van de laatst gebruikte opdracht (Anders is het zwart). Die tekst kan je niet veranderen.
De knop naast dat vakje geeft aan als de output opgeslagen en getoond wordt. Het toont een O (standaard) wanneer de output wordt opgeslagen en een X wanneer de output niet wordt opgeslagen. Een opdrachtblok die zijn output bijhoudt zal blok updates creëren. Wanneer je 64 opdrachtblokken hebt in dezelfde chunk die hun output bijhouden, worden er 1 of meer chunk updates gemaakt. Als er teveel chunk updates zijn, dan kan de FPS van de spelers dalen en dus lag produceren. Om dit te voorkomen, kan je het opslaan het best alleen gebruiken als je gaat debuggen.
Impuls / Ketting / Herhalen
Klik op de knop "Impuls/Ketting/Herhalen" om het type opdrachtblok te veranderen. De standaard optie is "Impuls", maar er kunnen ook niet-standaard opdrachtblokken worden geplaatst. Het opdrachtblok veranderd van kleur als je het type veranderd:
"Impuls"-opdrachtblokken zijn oranje. Ze worden eenmaal geactiveerd wanneer je ze aan zet.
"Ketting"-opdrachtblokken zijn groen. Deze opdrachtblokken voeren zichzelf alleen uit als het opdrachtblok achter hem is uitgevoerd. Het opdrachtblok gericht op een ketting-opdrachtblok hoeft niet altijd zelf een ketting-opdrachtblok zijn.
"Herhalen"-opdrachtblokken zijn paars. Zolang ze zijn geactiveerd werken ze 1 keer per game tick (20 keer per seconde, zonder lag).
Voorwaardelijk/Onvoorwaardelijk
Klik op de "Onvoorwaardelijke / voorwaardelijk" knop om het opdrachtblok Onvoorwaardelijke (standaard) gedrag te veranderen:
  • "Voorwaardelijk": Een opdrachtblok in "Voorwaardelijke"-modus zal alleen worden uitgevoerd als de opdracht ervoor het met succes is uitgevoerd. ("ervoor" betekent in de tegengestelde richting waarin het opdrachtblok gericht staat, zelfs ketting-opdrachtblokken).
  • "Onvoorwaardelijk" (standaard): Een opdrachtblok in Onvoorwaardelijke modus gaat zijn opdracht vanaf dat hij geactiveerd wordt uitvoeren, zelfs als die dat ervoor werd geactiveerd mislukte.
Vereist Redstone / Altijd actief
Klik op de Vereist Redstone / Altijd actief " knop om het opdrachtblok zijn activatie benodigdheden te wijzigen:
  • "Vereist Redstone" (de standaard optie voor impuls- en herhalend-opdrachtblokken): Een opdracht met de optie "Vereist Redstone" moet geactiveerd (zie § Activatie) met Redstone om de opdracht uit te voeren.
  • "Altijd actief" (de standaard optie voor ketting-opdrachtblokken): De opdracht is altijd actief, zelfs zonder activatie van Redstone (ketting-opdrachtblokken voeren hun opdracht op hun beurt uit in een ketting, herhalend-opdrachtblokken gaan hun opdracht elke game tick uitvoeren (20 keer/seconde), en impuls wordt eenmaal geactiveerd, daarna kunnen ze niet nogmaals geactiveerd worden).
Gereed
Klik op de "Gereed" knop of de ↵ Enter-toets om de opdracht op te slaan en verlaat het GUI.
Annuleren
Klik op de "Annuleren" knop of de Esc-toets voor het GUI te verlaten zonder iets op te slaan.

Activatie[]

Opdrachtblokken zijn Redstone mechanismes en kunnen geactiveerd worden door:

  • Een aangrenzend actief power component: bijvoorbeeld, een Redstone-fakkel (behalve dat een Redstone-fakkel een opdrachtblok niet zal activeren waar het aan vastgemaakt is), een Redstone-blok, een daglichtsensor, een knop enz.
  • Een aangrenzend powered block (bijvoorbeeld, een solide blok met een actieve Redstone-fakkel eronder)
  • Een powered Redstone-comparator of Redstone repeater in de richting van het mechanisme component
  • Powered Redstone-kabel geconfigureerd om naar het opdrachtblok te wijzen (of er bovenop) of richtingloos; een opdrachtblok is niet geactiveerd door aangrenzend powered Redstone dat niet in de richting ervan wijst.

Daarbij, wanneer een opdrachtblok gekopieerd wordt door een opdracht naar een powered locatie, zal het nieuwe opdrachtblok alleen zijn opdracht uitvoeren als het origineel nooit geactiveerd is (zichtbaar in het F3 debug scherm als "triggered").

In contrast met alle andere Redstone componenten behalve de nootblok, kan een opdrachtblok iedere game tick (20 keer per seconde, behoudens lag) geactiveerd worden. Echter, in twee achtereenvolgende game ticks activeren vereist dat het van powered omslaat in unpowered en weer terug gedurende dezelde tick (bijvoorbeeld met een setblock clock).

Een opdrachtblok in "Altijd Actief" modus is altijd geactiveerd. De standaard waarde is "Heeft Redstone nodig", wat betekent dat het alleen uitvoert wanneer powered.

Wanneer geactiveerd, zal een opdrachtblok proberen zijn opdracht uit te voeren. Afhankelijk van het opdrachtblok's type:

  • een opdrachtblok ("Impuls") zal zijn opdracht eenmalig proberen uit te voeren
  • een ketting opdrachtblok ("Ketting") zal niet proberen zijn opdracht uit te voeren tot een ander opdrachtblok dat ernaar wijst zijn eigen opdracht uitvoert
  • een herhaling opdrachtblok ("Herhalen") zal proberen zijn opdracht iedere game tick uit te voeren totdat hij niet meer geactiveerd is

Ketting uitvoering[]

Als een opdrachtblok naar een ketting opdrachtblok wijst (een opdrachtblok in "Ketting" modus) wanneer geactiveerd, zal hij het ketting opdrachtblok opvragen om ook proberen uit te voeren. Het ketting opdrachtblok zal alleen zijn opdracht uitvoeren als het geactiveerd is en, wanneer in "Conditioneel" modus, als het opdrachtblok erachter succesvol is uitgevoerd (achter in de zin van de richting waar het naar wijst, niet in de zin van welke opdrachtblok ermee een ketting maakt). Ongeacht of het ketting opdrachtblok geactiveerd is of succesvol uitvoert, als het naar een ander ketting opdrachtblok wijst, zal het hem opvragen om ook uit te voeren.

Ketting opdrachtblokken voeren in dezelfde game tick uit in de volgorde dat ze in ketting staan. Ketting uitvoering kan niet overgaan op een opdrachtblok dat in die game tick al uitgevoerd is (dus lussen voeren alleen enkelmalig uit).

Output[]

Wanneer geactiveerd, kan een command block meerdere sorten output produceren:

Redstone Comparator
A command block can power a redstone comparator facing away from it (possibly separated by a block) with a signal strength specific to the last executed command (for example, the number of players affected by the command).
The signal strength always reflects the last command executed, even after the command block is deactivated.
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 will write a message to the chat of all players), separate from the output message. Chat messages which would usually be prefaced by a player's name (such as from the /me, /say and /tell commands) use @ as the player name. If the command block had been named in an anvil before placement, that name will be used instead.
Logs: The output message is written to multiplayer server logs unless it has been suppressed with /gamerule logAdminCommands false.
Command Stats
Command blocks can post various success results to scoreboard objectives, including:
  • SuccessCount: the number of successes (previously also available by redstone comparator output, but not limited to 15)
  • AffectedBlocks: the number of blocks that were altered
  • AffectedEntities: the number of entities that were altered (including players)
  • AffectedItems: the number of items that were altered
  • QueryResult: value returned by command
The objectives to be used can be specified by running the /stats command or by modifying the command block's NBT data directly with the /blockdata command.

Notities[]

The following commands cannot be used in a command block: /ban, /banlist, /ban-ip, /debug, /deop, /kick, /op, /pardon, /pardon-ip, /publish, /save-all, /save-off, /save-on, /stop, and /whitelist (i.e., /debug, /publish, and all of the multiplayer-only commands except /list).

The following commands are usable but with limited functionality (their output only displays in the command block's Previous Output pane rather than being displayed in the chat): /help, /seed, /list, /scoreboard objectives, /scoreboard players, and /scoreboard teams list.

The following commands use the command block's name (defaults to @) in their output: /me, /say, and /tell.

Easter eggs[]

Hoofdartikel: Easter eggs#Command blocks


Running "Searge" as the command in the command block without a preceding "/" will now set the previous output to "#itzlipofutzli". Additionally, if /help is run via command block, it gives various messages prefixed with "Searge says: ".

Data nummers[]

A command block has an ID name of minecraft:command_block and is further defined by its block data and block entity. A command block also has a block state which replaces the functionality of block data.

ID[]

A command block's ID determines its mode:

Naam ID NummerID
Opdrachtblok minecraft:command_block 137
Herhalend commandblok minecraft:repeating_command_block 210
Kettingcommandblok minecraft:chain_command_block 211

Blok data[]

Zie ook: Data values

A command block's block data specifies whether the command block is currently activated.

Opdrachtblok/DV

Blok entiteit[]

Zie ook: Block entity format

A command block has a block entity associated with it that holds additional data about the block. The block's block entity ID is command_block.

Opdrachtblok/BE

Block state[]

Zie ook: Block states

Opdrachtblok/BS

Video[]

Onnauwkeurig

Opdrachtblok/video

Geschiedenis[]

Zie ook: Commands#History
Officiële release
27 July 2012Jeb 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 will be able to do.
31 July 2012During Notch's AMA he hinted the block may be in 1.4.
1.4.2 12w32a Bestand:Impulse Command Block JE1.png Added command block.
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.
1.6.1 13w19a Command blocks are no longer mineable in Survival, and are also not damaged by explosions except by Blue Wither Skulls.
1.7.2 13w37a Added a bar that shows the previous output.
Increased the character limit from 256 to 16,369 when inserting a command in-game. Using a third-party editor allows you to reach 32,767 characters.
1.8 14w07a Dispensers now place command blocks, instead of shooting it out.
14w20a Removed the in-game character limit of 16,369, allowing access to the full 32,767 characters.
14w27a Added CommandStats NBT tag.
1.8.6 Dispensers no longer place command blocks.[2]
1.9 15w33a Character limit is now 32,500 instead of 32,767
15w34a Bestand:Chain Command Block JE1.pngBestand:Repeating Command Block JE1.png Added Chain Command Block and Repeating Command Block.
Added block facing.
Bestand:Impulse Command Block JE2.png Updated block textures.
15w34b Added Conditional mode.
Added tab completion support.
15w35a Bestand:Impulse Impulse Command Block JE1.pngBestand:Chain Impulse Command Block JE1.pngBestand:Repeating Impulse Command Block JE1.png Updated texture of all three command blocks
Added Always active and needs redstone options. Added auto NBT tag to control this.
When set to conditional, the back of the arrow texture is curved.
15w36a Players unable to use commands such as /give 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 will now randomly use one of various different humorous phrases as the previous output.
16w04a Running "Searge" as the command in the command block without a preceding "/" will now set the previous output to "#itzlipofutzli".
1.11 16w32a The block entity ID is 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, 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.
Added maxCommandChainLength game rule to control the max length of such a 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 will no longer add a / prefix.
pocket
1.0.5 build 1 Added all types of command blocks.

Galerij[]

Problemen[]

Problemen met betrekking tot 'Opdrachtblok' worden bijgehouden op de bugtracker. Meld problemen daar.

Referenties[]


Advertisement