Command block

From Vintage Story Wiki

This page was last verified for Vintage Story version 1.19.8.


UnderCon icon.png

This page is under construction.
This page is being created, or is in the process of extensive expansion or major restructuring. Until this notice is removed, please do not translate this page. Expect the content of this page to change significantly.


Obtaining

Command blocks are in the Special tab of the creative inventory. Access creative mode in a survival world via commands such as /gamemode creative.

Command block

Command block

Shift+Right mouse button to edit, Right mouse button to activate. See List_of_server_commands for ideas of commands to trigger.

Try it!


Example: Shift+Right mouse button, type /announce Hello, click Save button. Right mouse button should result in Hello printing to the chat box.


Conditional block

Conditional block

Shift+Right mouse button to edit, Right mouse button to activate. Connect a Command block to at least 1 side of a Conditional block. On top of the Conditional block are small red and green boxes. A command block on the side with the green box will activate when the condition is met; a command block on the side with the red box will activate when the condition is unmet.


Conditional block closeup.png

The conditional logic block only can test for entities. Use either a player name or one of the following selection codes:

  • s[] for self
  • l[] for the entity currently looked at
  • p[] for all players
  • e[] for all entities

Inside the square brackets, one or more filters can be added, to be more selective. Filters include name, type, class, alive, range. For example, e[type=gazelle,range=3,alive=true]. The conditional block would register as true if a live gazelle comes within 3 blocks.

Try it!

Example: Place a conditional block such that the green box is on the side of the command block already configured to announce "Hello." Place another command block on the side with the red box, and Shift+Right mouse button to edit: type /announce Bye, click Save button. Shift+Right mouse button on the conditional block to edit: type e[range=3] to look for an entity within 3 blocks of the conditional block. Right mouse button on the conditional block should result in Hello printing to the chat box if the player is standing within 3 blocks of the conditional block, but result in Bye if the player is further than 3 blocks when activating the conditional block.

Ticker block

Ticker block

See ServerBlockTicking for an idea of what ticks are.





Requires testing

The filters minx/miny/minz/maxx/maxy/maxz can also be used to specify a volume to search; coordinates are relative to the command caller's position.

Find the entity id by using .clientConfig showEntityDebuginfo. Useful for removing a specific trader permanently, for instance.

This argument may be omitted if the remainder of the command makes sense, in which case it will be interpreted as self.


History

Notes

Tyron posted "the conditional logic block only can test for entities right now and on success triggers an adjacent command block. green square side for true condition, red square side for false condition. the conditional block also needs triggering by the player or by an adjacent ticker block"

Gallery

a view of the Conditional block showing true (green) and false (red) output directions
Conditional block closeup













Video tutorials

Entity range

See also

References


Wiki Navigation
Vintage Story Guides[[::Category:Guides| ]]Frequently Asked Questions Soundtrack Versions Controls
Game systems Crafting Knapping Clay forming Smithing Cooking Temperature Hunger Mining Temporal stability Mechanical power Trading Farming Animal husbandry
World World generation Biomes Weather Temporal storms
Items Tools Weapons Armor Clothing Bags Materials Food
Blocks Terrain Plants Decorative Lighting Functional Ore
Entities Hostile entities Animals NPCs Players
Miscellaneous List of client commands List of server commands Creative Starter Guide Bot System WorldEdit Cinematic Camera Adjustable FPS Video Recording ServerBlockTicking