Module:Command/Syntax

来自Minecraft基岩版开发Wiki

This table defines the syntax for known commands.

Each parameter should be a separate value in the table and optional parameters should be specified as sub-tables without the parenthesis. Command aliases can be created by putting a string containing a command name, rather than a table.

HTML here is not escaped, so anything that looks like HTML but isn't supposed to be must be wrapped in <nowiki> tags.

return {
	['?'] = 'help',
		help = { { "[<''page''>|<''command''>]" } },
	achievement = { "[give|take]", "[<''stat_name''>|*]", { "<''player''>" } },
	ban = 'kick',
		kick = { "<''player''>", { "<''reason''>" } },
	['ban-ip'] = 'pardon-ip',
		['pardon-ip'] = { "<''ip''>" },
	banlist = { { "[ips|players]" } },
	blockdata = { "<''x''>", "<''y''>", "<''z''>", "<''dataTag''>" },
	clear = { { "<''player''>", "<''item''>", "<''data''>", "<''maxCount''>", "<''dataTag''>" } },
	clone = { "<''x1''>", "<''y1''>", "<''z1''>", "<''x2''>", "<''y2''>", "<''z2''>", { "<''maskMode''>",  "<''cloneMode''>",  "<''TileName''>", } },
	debug = { "<''operation'':[start|stop]>" },
	defaultgamemode = { "<''mode'':" .. '[<abbr title="Survival">0</abbr>|<abbr title="Creative">1</abbr>|<abbr title="Adventure">2</abbr>|<abbr title="Spectator">3</abbr>]>' },
	deop = 'pardon',
		op = 'pardon',
		pardon = { "<''player''>" },
	difficulty = { "<''difficulty'':" .. '[<abbr title="Peaceful">0</abbr>|<abbr title="Easy">1</abbr>|<abbr title="Normal">2</abbr>|<abbr title="Hard">3</abbr>]>' },
	effect = { "<''player''>", "[clear|<''effect''>]", { "<''seconds''>", "<''amplifier''>", "<hideParticles''>" } },
	enchant = { "<''player''>", "<''enchantment ID''>", { "<''level''>" } },
	entitydata = { "<''entity''>", "<''dataTag''>" },
	execute = { "<''entity''>", "<''x''>", "<''y''>", "<''z''>", "[<''command''>|detect]", { "<''x2''>", "<''y2''>", "<''z2''>", "<''block''>", "<''command''>" } },
	fill = { "<''x1''>", "<''y1''>", "<''z1''>", "<''x2''>", "<''y2''>", "<''z2''>", "<''tileName''>", { "<''dataValue''>", "<''oldBlockHandling'':[destroy|hollow|keep|outline|replace]>", "[<''dataTag''>|<''replaceTileName''>]", { "<''replaceDataValue''>" } } },
	['function'] = { "<''namespace:path/to/function/file''>" },
	gamemode = { "<''mode'':" .. '[<abbr title="Survival">0</abbr>|<abbr title="Creative">1</abbr>|<abbr title="Adventure">2</abbr>|<abbr title="Spectator">3</abbr>]>', { "<''player''>" } },
	gamerule = { "<''rule name''>", { "<''value'':[true|false|<''number''>]>" } },
	give = { "<''player''>", "<''data-value''>", { "<''amount''>", "<''damage-value''>", "<''dataTag''>" } },
	kill = { { "[<''player''>|<''entity''>]" } },
	me = { "<''action''>" },
	msg = w,
		tell = w,
		w = { "<''player''>", "<''message''>" },
	particle = { "<''name''>", "<''x''>", "<''y''>", "<''z''>", "<''xd''>", "<''yd''>", "<''zd''>", "<''speed''>", { "<''count''>", "<''mode''>" } },
	playsound = { "<''sound''>", "<''player''>", { "<''x''>", "<''y''>", "<''z''>", "<''volume''>", "<''pitch''>", "<''minimumVolume''>" } },
	replaceitem = { "[block|entity]", "[<''x''> <''y''> <''z''>|<''selector''>]", "<''slot''>", "<''item''>", { "<''amount''>", "<''data''>", "<''dataTag''>" } },
	say = { "<''message''>" },
        schedule = {"(function|clear)", "<''function''>", "<''delay''>[d|s|t]", "[append|replace]" },
	setblock = { "<''x''>", "<''y''>", "<''z''>", "<''tilename''>", { "<''datavalue''>", "<''oldblockHandling''>", "<''dataTag''>" } },
	setidletimeout = { "<''minutes until kick''>" },
	setworldspawn = { { "<''x''>", "<''y''>", "<''z''>" } },
	spawnpoint = { { "<''player''>", { "<''x''>", "<''y''>", "<''z''>" } } },
	spreadplayers = { "<''x''>", "<''z''>", "<''spreadDistance''>", "<''maxRange''>", "<''respectTeams'':[true|false]>", "<''players''>" },
	stats = { "[block|entity]", "[<''x''> <''y''> <''z''>|<''selector2''>]", "[clear|set]", "<''stat''>", { "<''selector''>", "<''objective''>" } },
	stopsound = {"<player>", "[<source>]", "[<sound>]"},
	summon = { "<''EntityName''>", { "<''x''>", "<''y''>", "<''z''>", "<''dataTag''>" } },
	tellraw = { "<''player''>", "<''raw json message''>" },
	testfor = { "<''player''>", { "<''dataTag''>" } },
	testforblock = { "<''x''>", "<''y''>", "<''z''>", "<''TileName''>", { "<''dataValue''>", "<''dataTag''>" } },
	testforblocks = 'testforblock2',
		testforblock2 = { "<''x1''>", "<''y1''>", "<''z1''>", "<''x2''>", "<''y2''>", "<''z2''>", "<''x''>", "<''y''>", "<''z''>", { "<''mode''>" } },
	time = { "<''operation'':[set|add|query]>", "<''value''>" },
	title = { "<''player''>", "[clear|reset|subtitle <''raw json title''>|times <''fadeIn''> <''stay''> <''fadeout''>|title <''raw json title''>]" },
	tp = { "<''player''>", "[<''destination-player''>|<''x''> <''y''> <''z''>]", { "<''y-rot''> <''x-rot''>" } },
	trigger = { "<''objective''>", "[add|set]", "<''value''>" },
	weather = { "<''option'':[clear|rain|thunder]>", { "<''time''>" } },
	whitelist = { "<''operation'':[add <''player''>|remove <''player''>|list|on|off|reload]>" },
	worldborder = { "[add <''sizeInBlcks''>|center <''x''> <''z''>|damage amount <''damagePerBlock''>|damage buffer <''sizeInBlocks''>|get|set <''sizeInBlocks''>|warning distance <''blocks''>|warning time <''seconds''>]", { "<''timeInSeconds''>" } },
	xp = { "<''amount''>", "<''player''>" },
}