Topic category: User side tutorials
Today I am going to tell you how to add custom fonts to your mod!
This tutorial will teach you:
- How to add fonts to mod
- How to use fonts in /tellraw command
- How to use fonts in books
- How to use fonts on signs
- How to use fonts in /title command
- How to change default minecraft font in mods
HOW TO ADD FONTS TO MOD
IMPORTANT: Fonts are required to be .ttf files (TrueType font file)
In your workspace, at the top left-ish, click "workspace", then "open workspace folder". This will bring you to your workspace directory in file explorer. Go to this directory:
<your workspace>\src\main\resources\assets\<your mod name> and create a folder named "font". Inside the font folder, create a text file named whatever you want your font to be named, and rename the extension (.txt) to ".json". Inside the file, copy and paste the following code:
{
"providers": [
{
"type": "ttf",
"file": "MOD ID/NAMESPACE:FONT NAME.ttf",
"shift": [0, 0],
"size": 11.0,
"oversample": 2.0
}
]
}
Replace "MOD ID/NAMESPACE" with your mod id (or namespace) by default this is your mod name in all lowercase letters, replacing all spaces with underscores (_) and using no symbols such as commas or other things (';:.,<>?!@#$%^&*()-= etc.) Example: if my mod name was "Craft The Uncraftable!" the id/namespace would be "craft_the_uncraftable". replace "FONT NAME" with the name of your font file. Now you have the json file, but not the font itself. Put the font file (.ttf file) in the font folder, with the json file. your font is now in the mod resource pack.
HOW TO USE FONTS IN /TELLRAW COMMAND
/tellraw @p {"text":"TEXT","font":"MOD ID/NAMESPACE:FONT NAME"}
Replace "TEXT", "MOD ID/NAMESPACE", and "FONT NAME" with the appropriate answers.
HOW TO USE FONTS IN BOOKS
For books it is recommended to use a generator such as minecraftjson.com
HOW TO USE FONTS ON SIGNS
For signs it is recommended to use a generator such as minecraftjson.com
HOW TO USE FONTS IN /TITLE COMMAND
/title @a title {"text":"TEXT","font":"MOD ID/NAMESPACE:FONT NAME"}
Replace "TEXT", "MOD ID/NAMESPACE", and "FONT NAME" with the appropriate answers.
HOW TO CHANGE DEFAULT FONT IN MODS
This tutorial has only shown you how to ADD fonts not REPLACE fonts. If you want to replace the default font in minecraft (The one used in menus, chat, etc.) then follow these steps:
- Rename the .json file (font name.json) to default.json
- Go to <your workspace>\src\main\resources\assets, and create a folder named "minecraft"
- Move your font folder to the minecraft folder
- Done! Your font will now replace the default minecraft font.
How can I use custom font with overlays and GUIs
I would also like to know how to use this with GUIs and overlays
Also I’d like to know how to use it in things like the names of items and tooltips
You can try more fonts at this site: https://schriftarten.io/