Jump to content

📢 Please make sure to read our Style Guide before editing. For questions, suggestions, or technical issues, please contact Noah.

Module:Infobox Player: Difference between revisions

From CrabCraft Wiki
added more fields
added skin image
Line 10: Line 10:
     local player_args = {
     local player_args = {
     {'t', args.username},
     {'t', args.username},
    {'i', 'https://mc-heads.net/player/' .. args.username .. '/100.png'},
     {'s', 'About'},
     {'s', 'About'},
     {'f', 'Nationality', args.nationality},
     {'f', 'Nationality', args.nationality},

Revision as of 20:50, 21 June 2025

Documentation for this module may be created at Module:Infobox Player/doc

local p = {}

local infobox = require("Module:Infobox")

function p.infobox(frame)
    local args = frame:getParent().args
    local used = {} -- track which keys we’ve output
    local out = {}
    
    local player_args = {
    	{'t', args.username},
    	{'i', 'https://mc-heads.net/player/' .. args.username .. '/100.png'},
    	{'s', 'About'},
    	{'f', 'Nationality', args.nationality},
    	{'f', 'Season Joined', args.seasonjoined},
    	{'f', 'Quote', args.quote},
    	{'s', 'Socials'},
    	{'f', 'Alias', args.alias},
    	{'f', 'Discord', args.discord},
    	{'s', 'Government'},
    	{'f', 'Minister Role', args.ministerrole},
    	{'f', 'Assumed Office', args.assumedoffice},
    	{'f', 'Preceded By', args.precededby},
    	{'s', 'Favourite:'},
    	{'f', 'Item', args.favouriteitem},
    	{'f', 'Block', args.favouriteblock},
    }

    return infobox.infobox {
    	getParent = function() return { args = player_args } end
    }
end

return p