VOOZH about

URL: https://minecraft.wiki/w/Module:ID_table

⇱ Module:ID table – Minecraft Wiki


Module:ID table

From Minecraft Wiki
Jump to navigation Jump to search
Documentation[view] [edit] [history] [purge]Jump to code ↴

Usage

This module implements {{ID table}}.

[view] [edit] [history] [purge]The above documentation is transcluded from Module:ID table/doc.
require('strict')
localp={}
localfunctionclean(data)
local_data=data
iftype(_data)=="table"then
fori,vinpairs(_data)do
_data[i]=clean(v)
end
elseiftype(_data)=="string"then
localcleaned=mw.text.split(_data,"&#?%w%w%w%w%w?;")[1]
:gsub("<br>"," ")
:gsub("|"," ")
:gsub("[%[%]<>#]","")
cleaned=mw.text.killMarkers(cleaned)
cleaned=mw.text.nowiki(cleaned)
cleaned=mw.text.trim(cleaned)
returncleaned
end
return_data
end
functionp.main(f)
localargs=f
iff==mw.getCurrentFrame()then
args=require([[Module:ProcessArgs]]).merge(true)
end
localnoCat=args.nocat
ifnoCatthen
return
end
localedition=args.edition-- "java" or "bedrock"
localdisplayName=args.displayname
localspriteType=args.spritetype-- "block", "entity", "biome", or "env"
localnameId=args.nameid
localaliasId=args.aliasid
localnumericId=args.id
localitemForm=args.itemformorargs.itemform2-- "Identical" if block and entity share the same nameid
localform=args.form-- "block" or "item" id only. unset for both. for bedrock: "block" = no /give command 
localfluidTags=args.fluidtags
localblockTags=args.blocktags
localitemTags=args.itemtags
localentityTags=args.entityTags
localtranslationKey=args.translationkey
localtranslationType=args.translationtypeorspriteType
ifform==nilthen
form={'block','item'}
end
localsubname=(spriteTypeor'ID')..'_'..(nameIdordisplayName)
subname=string.lower(clean(subname))
:gsub(" ","_")
localbucket_json={
['Edition']=edition,
['Display name']=displayName,
['Type']=spriteType,
['Resource location']=nameId,
['Alias ID']=aliasId,
['Numeric ID']=numericId,
['Item form']=itemForm,
['Form']=form,
['Fluid tags']=fluidTags,
['Block tags']=blockTags,
['Item tags']=itemTags,
['Entity tags']=entityTags,
['Translation key']=translationKey,
['Translation type']=translationType
}
localbucket_sub={
['edition']=clean(edition),
['display_name']=clean(displayName),
['resource_location']=clean(nameId),
['json']=mw.text.jsonEncode(bucket_json)
}
mw.ext.bucket('resource_location').sub(subname).put(bucket_sub)
end
returnp
Retrieved from "https://minecraft.wiki/w/Module:ID_table?oldid=3623331"

Navigation menu