Module:Command/Syntax: Difference between revisions

From Modded Wiki
Jump to navigation Jump to search
m 1.17
mNo edit summary
 
Line 158: Line 158:
         itemreplacefrom = {{itemsource={'block','entity'}}, '<sourceSlot>', '[<modifier>]'},
         itemreplacefrom = {{itemsource={'block','entity'}}, '<sourceSlot>', '[<modifier>]'},
     itemtargetblock = { '<pos>' },
     itemtargetblock = { '<pos>' },
     itemtargetentity = { 'targets' },
     itemtargetentity = { '<targets>' },
     itemsourceblock = { '<sourcePos>' },
     itemsourceblock = { '<sourcePos>' },
     itemsourceentity = { '<sourceTarget>' },
     itemsourceentity = { '<sourceTarget>' },

Latest revision as of 09:32, 16 July 2021

Documentation for this module may be created at Module:Command/Syntax/doc

return {
	command = {{command={'advancement','attribute','ban','ban-ip','banlist','bossbar','clear','clone','data','datapack','debug','perf','defaultgamemode','deop',
						'difficulty','effect','enchant','experience','xp','fill','forceload','function','gamemode','gamerule','give',
						'help','kick','kill','list','locate','locatebiome','loot','me','msg','tell','w','op','pardon','pardon-ip',
						'particle','playsound','publish','recipe','reload','save-all','save-off','save-on','item','say','schedule','scoreboard', 'seed',
						'setblock','setidletimeout','setworldspawn','spawnpoint','spectate','spreadplayers','stop','stopsound','summon','tag','team','tm','teammsg',
						'teleport','tp','tellraw','time','title','trigger','whether','whitelist','worldboard','execute'
						
	}}},
	commandexecute = {{execute={'align','anchored','as','at','facing','in','positioned','rotated','if','unless','store','run'}}},
		executealign = {'<axes>', redirect='commandexecute'},
		executeanchored = {'<anchor>', redirect='commandexecute'},
		executeas = {'<targets>', redirect='commandexecute'},
		executeat = {'<targets>', redirect='commandexecute'},
		executefacing = { {executesub = {"<''x''>",'entity'}},redirect='commandexecute'},
			executesubentity = {'<targets>','<anchor>'},
			["executesub<''x''>"] = {"<''y''>","<''z''>"},
		executein = {'<dimension>', redirect='commandexecute'},
		executepositioned = { {executesub = {"<''x''>",'as'}},redirect='commandexecute'},
			executesubas = {'<targets>'},
		executerotated = { {executesub = {"<''yaw''>",'as'}},redirect='commandexecute'},
			["executesub<''yaw''>"] = {"<''pitch''>"},
		executestore = {'(result|success)',{executestore = {'block','bossbar','entity','score','storage'}},redirect='commandexecute'},
			executestoreblock={"<''x''>","<''y''>","<''z''>",'<path>','<type>','<scale>' },
			executestorebossbar={'<id>','(max|value)'},
			executestoreentity={"<target>",'<path>','<type>','<scale>' },
			executestorescore={'<targets>','<objective>'},
			executestorestorage={"<target>",'<path>','<type>','<scale>' },
		executeif = {{executeif={'block','blocks','data','entity','predicate','score'}},redirect='commandexecute'},
		executeunless = {{executeif={'block','blocks','data','entity','predicate','score'}},redirect='commandexecute'},
			executeifblock = {"<''x''>","<''y''>","<''z''>",'<block>'},
			executeifblocks = {"<''x1''>","<''y1''>","<''z1''>","<''x2''>","<''y2''>","<''z2''>","<''x3''>","<''y3''>","<''z3''>", '(all|masked)'},
			executeifdata = {{executeifdata = {'block','entity','storage'}},'<path>'},
				executeifdatablock={"<''x''>","<''y''>","<''z''>"},
				executeifdataentity={'<source>'},
				executeifdatastorage={'<source>'},
			executeifentity = {'<entities>'},
			executeifpredicate = {'<predicate>'},
			executeifscore = {'<target>','<targetObjective>',{executeifscore={'matches','(<|<=|=|>|>=)'}}},
				['executeifscore(<|<=|=|>|>=)']={'<source>','<sourceObjective>'},
				executeifscorematches = {'<range>'},
		executerun = {redirect='command'},
	commandhelp = {'[<command>]'},
	commandadvancement = { '(grant|revoke)', '<targets>', {advancement= { 'everything', 'from', 'through', 'until', 'only' }} },
		advancementfrom = {'<advancement>'},
		advancementthrough = {'<advancement>'},
		advancementuntil = {'<advancement>'},
		advancementonly = {'<advancement>', '[<criterion>]'},
	commandattribute = {'<target>', '<attribute>', {attribute={'get', 'base', 'modifier'}}},
		attributeget = {'[<scale>]'},
		attributebase = {{attributebase = {'get','set'}}},
			attributebaseget = {'[<scale>]'},
			attributebaseset = {'<value>'},
		attributemodifier = {{attributemodifier = {'add','remove','value'}}},
			attributemodifieradd = {'<uuid>','<name>','<value>','(add|multiply|multiply_base)'},
			attributemodifierremove = {'<uuid>'},
			attributemodifiervalue = {'get','<uuid>','[<scale>]'},
	['commandban-ip'] = {"<target>", "[<reason>]"},
	commandkick = { "<target>", "[<reason>]" },
	commandban = { "<targets>", "[<reason>]" },
	commandbanlist = { "[ips|players]" },
	commandbossbar = {{bossbar={'add','get','list','remove','set'}}},
		bossbaradd = {'<id>','<name>'},
		bossbarget = {'<id>','(max|players|value|visible)'},
		bossbarremove = {'<id>'},
		bossbarset = {'<id>',{bossbarset={'color','max','name','players','style','value','visible'}}},
			bossbarsetcolor = {'(blue|green|pink|purple|red|white|yellow)'},
			bossbarsetmax = {'<max>'},
			bossbarsetname = {'<name>'},
			bossbarsetplayers = {'[<targets>]'},
			bossbarsetstyle = {'(notched_6|notched_10|notched_12|notched_20|progress)'},
			bossbarsetvalue = {'<value>'},
			bossbarsetvisible = {'<visible>'},
	commandclear = { "[<targets>]", "[<item>]", "[<maxCount>]" },
	commandclone = { "<''x1''>", "<''y1''>", "<''z1''>", "<''x2''>", "<''y2''>", "<''z2''>", "<''x3''>", "<''y3''>", "<''z3''>", {clone={ 'replace','masked','filtered' }}, '[force|move|normal]' },
		clonefiltered = {'<filter>'},
	commanddata = {{data={'get','merge','modify','remove'}}},
		dataget = {{data={'block','entity','storage'}},'[<path>]','[<scale>]'},
		datamerge = {{data={'block','entity','storage'}},'<nbt>'},
		dataremove = {{data={'block','entity','storage'}},'<path>'},
		datamodify = {{data={'block','entity','storage'}},'<targetPath>',{datamodify={'append','insert','merge','prepend','set'}},{datasrc={'from','value'}}},
			datamodifyinsert = {'<index>'},
		datasrcfrom = {{data={'block','entity','storage'}},'[<sourcePath>]'},
		datasrcvalue = {'<value>'},
		datablock = {"<''x''>","<''y''>","<''z''>"},
		dataentity = {'<entity>'},
		datastorage = {'<storage>'},
	commanddatapack = {{datapack={'disable','enable','list'}}},
		datapackdisable = {'<name>'},
		datapackenable = {'<name>',{datapackenable={'first','last','before','after'}}},
		datapacklist = {'[available|enabled]'},
		datapackenablebefore = {'<existing>'},
		datapackenableafter = {'<existing>'},
	commanddebug = { {debug={'start','stop','function'}} },
		debugfunction = {'<name>'},
	commandperf = { '(start|stop)' },
	commanddefaultgamemode = { '(survival|creative|adventure|spectator)' },
	commanddeop = {"<targets>"},
	commandop = {"<targets>"},
	commandpardon = { "<targets>" },
	['commandpardon-ip'] = { "<target>" },
	commanddifficulty = { '[easy|hard|normal|peaceful]' },
	commandeffect = { {effect={'clear','give'}} },
		effectclear = {'[<targets>]','[<effect>]'},
		effectgive = { '<targets>','<effect>','[<seconds>]','[<amplifier>]','[<hideParticles>]' },
	commandenchant = { "<targets>", "<enchantment>", "[<level>]" },
	commandexperience = { {xp = {'add','set','query'}} },
		commandxp = { redirect='commandexperience' },
		xpadd = {'<targets>','<amount>','[levels|points]'},
		xpset = {'<targets>','<amount>','[levels|points]'},
		xpquery = {'<targets>','(levels|points)'},
	commandfill = { "<''x1''>", "<''y1''>", "<''z1''>", "<''x2''>", "<''y2''>", "<''z2''>", "<block>",{ fill = { 'destroy','hollow','keep','outline','replace'} }},
		fillreplace = { '[<filter>]' },
	commandforceload = {{ forceload = {'add','remove','query'} }},
		forceloadadd = {"<''x1''>","<''z1''>","[<''x2''>]","[<''z2''>]"},
		forceloadremove = {{forceloadremove = {'all',"<''x1''>"}}},
			["forceloadremove<''x1''>"] = {"<''z1''>","[<''x2''>]","[<''z2''>]"},
		forceloadquery = {"[<''x''>]","[<''z''>]"},
	commandfunction = { "<name>" },
	commandgamemode = { '(adventure|creative|spectator|survival)','[<target>]' },
	commandgamerule = { "<''rule name''>", "[<value>]" },
	commandgive = { "<target>", "<item>", "[<count>]" },
	commandkill = { "[<targets>]" },
	commandlist = {'[uuid]'},
	commandlocate = {"<''StructureType''>"},
	commandlocatebiome = {"<''biome ID''>"},
	commandloot = {{loottarget = {'spawn','replace','insert','give'}}, {lootsrc = {'fish','loot','kill','mine'}}},
		loottargetspawn = {"<''x''>","<''y''>","<''z''>"},
		loottargetreplace = {{loottarget = {'entity','block'}}, '<slot>','[<count>]'},
		loottargetentity = {'<entities>'},
		loottargetblock = {"<''x''>","<''y''>","<''z''>"},
		loottargetinsert = {"<''x''>","<''y''>","<''z''>"},
		loottargetgive = {'<players>'},
		lootsrcfish = {'<loot_table>',"<''x''>","<''y''>","<''z''>",'[<tool>|mainhand|offhand]'},
		lootsrcloot = {'<loot_table>'},
		lootsrckill = {'<target>'},
		lootsrcmine = {"<''x''>","<''y''>","<''z''>",'[<tool>|mainhand|offhand]'},
	commandme = { "<action>" },
	commandmsg = { "<targets>", "<message>" },
		commandtell = { redirect = 'commandmsg' },
		commandw = { redirect = 'commandmsg' },
	commandparticle = { {particle={'dust','dust_color_transition','block','falling_dust','item','vibration','<name>'}}, "[<''x''>]", "[<''y''>]", "[<''z''>]", "[<''xd''>]", "[<''yd''>]", "[<''zd''>]", "<speed>", "<count>", '[force|normal]', '[<viewers>]' },
		particledust = {"<''r''>","<''g''>","<''b''>","<''size''>"},
		particledust_color_transition = {"<''r1''>","<''g1''>","<''b1''>","<''size''>","<''r2''>","<''g2''>","<''b2''>"},
		particleblock = {"<''block''>"},
		particlefalling_dust = {"<''block''>"},
		particleitem = {"<''item''>"},
		particlevibration = {"<''x1''>","<''y1''>","<''z1''>","<''x2''>","<''y2''>","<''z2''>","<''duration''>"},
	commandplaysound = { "<sound>", "<''source''>", "<targets>", "[<''x''>]", "[<''y''>]", "[<''z''>]", "[<volume>]", "[<pitch>]", "[<minVolume>]" },
	commandpublish = {'[<port>]'},
	commandrecipe = {'(give|take)', '<targets>', {{'*','<recipe>'}}},
	['commandsave-all'] = {'[flush]'},
	--commandreplaceitem = { "[block|entity]", "[<''x''> <''y''> <''z''>|<''selector''>]", "<''slot''>", "<''item''>", { "<''amount''>", "<''data''>", "<''dataTag''>" } },
	commanditem = { {item={'modify','replace'}} },
    	itemmodify = { {itemtarget={'block','entity'}}, '<slot>', '<modifier>'},
    	itemreplace = { {itemtarget={'block','entity'}}, '<slot>', {itemreplace={'with','from'}} },
    	    itemreplacewith = {'<item>', '[<count>]'},
    	    itemreplacefrom = {{itemsource={'block','entity'}}, '<sourceSlot>', '[<modifier>]'},
    	itemtargetblock = { '<pos>' },
    	itemtargetentity = { '<targets>' },
    	itemsourceblock = { '<sourcePos>' },
    	itemsourceentity = { '<sourceTarget>' },
	commandsay = { "<message>" },
	commandschedule = { {schedule={'function','clear'}} },
    	schedulefunction = { '<function>', '<time>', '[append|replace]'},
    	scheduleclear = { '<function>' },
    commandscoreboard = {{scoreboard={'objectives','players'}}},
    	scoreboardobjectives = {{scoreboardobjectives={'add','list','modify','remove','setdisplay'}}},
    		scoreboardobjectivesadd = { '<objective>','<criterion>','[<displayName>]'},
    		scoreboardobjectivesmodify = {'<objective>',{scoreboardobjectivesmodify={'displayname','rendertype'}}},
    			scoreboardobjectivesmodifydisplayname = {'<displayName>'},
    			scoreboardobjectivesmodifyrendertype = {'(hearts|integer)'},
    		scoreboardobjectivesremove = {'<objective>'},
    		scoreboardobjectivessetdisplay = {'<slot>','[<objective>]'},
    	scoreboardplayers = {{scoreboardplayers={'add','enable','get','list','operation','remove','reset','set'}}},
    		scoreboardplayersadd = {'<targets>', '<objective>', '<score>'},
    		scoreboardplayersenable = {'<targets>','<objective>'},
    		scoreboardplayersget = {'<target>', '<objective>'},
    		scoreboardplayerslist = {'[<target>]'},
    		scoreboardplayersoperation = {'<targets>', '<targetObjective>', '<operation>', '<source>', '<sourceObjective>'},
    		scoreboardplayersremove = {'<targets>', '<objective>', '<score>'},
    		scoreboardplayersreset = { '<targets>', '[<objective>]'},
    		scoreboardplayersset = { '<targets>', '<objective>', '<score>'},
	commandsetblock = { "<''x''>", "<''y''>", "<''z''>", "<block>", '[destroy|keep|replace]' },
	commandsetidletimeout = { "<minutes>" },
	commandsetworldspawn = { "<''x''>", "<''y''>", "<''z''>", '<angle>' },
	commandspawnpoint = { "[<targets>]", "[<''x''>]", "[<''y''>]", "[<''z''>]", '[<angle>]' },
	commandspectate = {'<target>', '[<player>]'},
	commandspreadplayers = { "<''x''>", "<''z''>", "<spreadDistance>", "<maxRange>", {spreadplayers={'under','<respectTeams>'}}, '<targets>'},
		spreadplayersunder = {'<maxHeight>','<respectTeams>'},
	commandstopsound = {"<targets>", "[<''source''>]", "<sound>"},
	commandsummon = { "<entity>", "[<''x''>]", "[<''y''>]", "[<''z''>]", "[<nbt>]" },
	commandtag = {'<targets>',{tag = {'add','list','remove'}}},
		tagadd = {'<name>'},
		tagremove = {'<name>'},
	commandteam = {{team = {'add','empty','join','leave','list','modify','remove'}}},
		teamadd = {'<team>','[<displayName>]'},
		teamempty = {'<team>'},
		teamjoin = {'<team>','[<members>]'},
		teamleave = {'<members>'},
		teamlist = {'[<team>]'},
		teammodify = {'<team>','<option>','<value>'},
		teamremove = {'<team>'},
	commandteammsg = {'<message>'},
		commandtm = {redirect = 'commandteammsg'},
	commandtellraw = { "<targets>", "<message>" },
	commandtime = {{ time = { 'add','query','set' } }},
		timeadd = {'<time>'},
		timequery = {'(daytime|gametime|day)'},
		timeset = {"(<''TimeSpec''>|<time>)"},
	commandtitle = { "<targets>", {title = { 'clear','reset','title','subtitle','actionbar','times'}}},
		titletitle = {'<title>'},
		titlesubtitle = {'<title>'},
		titleactionbar = {'<title>'},
		titletimes = {'<fadeIn>','<stay>','<fadeOut>'},
	commandteleport = {{tp2={'<targets>','<destination>',"<''x''>"}}},
		['tp2<targets>'] = {{tp = {"<''x''>",'<destination>'}}},
		["tp<''x''>"] = {"<''y''>","<''z''>",{tp={'facing',"<''yRot''>"}}},
		tpfacing = {{tp2 = {'entity',"<''x''>"}}},
		tp2entity = {'<facingEntity>','[<facingAnchor>]'},
		["tp2<''x''>"] = {"<''y''>","<''z''>"},
		["tp<''yRot''>"] = {"<''xRot''>"},
		commandtp = {redirect='commandteleport'},
	commandtrigger = { "<objective>", "[add|set]", "[<value>]" },
	commandweather = { "[clear|rain|thunder]", "[<duration>]" },
	commandwhitelist = { {whitelist = {'add','list','off','on','reload','remove'} }},
		whitelistadd = {'<targets>'},
		whitelistremove = {'<targets>'},
	commandworldborder = { {worldborder = {'add','center','damage','get','set','warning',''}}},
		worldborderadd = {'<distance>','[<time>]'},
		worldbordercenter = {"<''x''>", "<''z''>"},
		worldborderdamage = {{worldborderdamage = {'amount','buffer'}}},
			worldborderdamage = {'<damagePerBlock>'},
			worldborderdamage = {'<distance>'},
		worldborderset = {'<distance>','[<time>]'},
		worldborderwarning = {{worldborderwarning={'distance','time'}}},
			worldborderwarningdistance = { '<distance>' },
			worldborderwarningtime = { '<time>' }
}