Minecraft Wiki

除另有声明,转载时均必须注明出处若簡繁轉換出錯,請以遊戲內為準请勇于扩充与修正内容有兴趣逛逛我们的微博沟通交流,欢迎到社区专页需要协助,请在告示板留言

了解更多

Minecraft Wiki
Advertisement

使用文档请见Template:GameTag/doc

数据模块

  • data:正式版数据模块。
  • snap:快照数据模块。
  • TagType:标签类型配置模块。

数据模块可通过脚本生成(下载:不含实验性内容含实验性内容),使用方法请参阅说明文档

报错分类

local p = {}
local all = mw.loadData('Module:Sandbox/Tag/All')

function p.main(f)
	local args = f
	if f == mw.getCurrentFrame() then
		args = f:getParent().args
	end
	
	--'blocks','items','entity_types','fluids','game_events'
	
	local objtype
	if args[1] == 'block' or args[1] == 'blocks' then
		objtype='blocks'
	end
	
	if args[1] == 'item' or args[1] == 'items' then
		objtype='items'
	end
	
	if args[1] == 'entity_type' or args[1] == 'entity_types' or args[1] == 'entity'then
		objtype='entity_types'
	end
	
	if args[1] == 'fluid' or args[1] == 'fluids' then
		objtype='fluids'
	end
	
	if args[1] == 'game_event' or args[1] == 'game_events' then
		objtype='game_events'
	end
	
	if not args[1] or args[1] == '' then
		return '空标签类型'
	end
	
	local id = args[2]
	
	local outtable=all['ID'][objtype][id]
	
	return table.concat(table.sort(outtable),',')
end

return p
Advertisement