User Tools

Site Tools


tutorial:terms

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tutorial:terms [2019/08/14 04:49] shedanieltutorial:terms [2020/02/21 12:08] – Add initializers. mkpoli
Line 12: Line 12:
  
 ==== Tags ==== ==== Tags ====
-Draft. Edit it.+**This section is a draft. Edit it.**
  
 Convention namespace for tags is ''c''. Convention namespace for tags is ''c''.
 +
 +read more on the [[https://minecraft.gamepedia.com/Tag|Minecraft Wiki]]
 +
 +==== Entry Points and Initializers ====
 +Fabric Loader use ''fabric.mod.json'' to detect and load your mod.
 +
 +A mod must contain at least one initializer class which should implement one of ''ModInitializer'', ''ClientInitializer'' and ''ServerInitializer''. The interfaces are all in the ''net.fabricmc.api'' package. In order to change or add initializers, you need to edit ''fabric.mod.json'' and find ''entrypoints'' block, then edit them accordingly. ''main'' block is for Mod Initializers, ''client'' block is for Client Mod Initializers and ''server'' block is for Server Mod Initializers.
 +
 +<code java>
 +{
 +  [...]
 +  "entrypoints": {
 +    "main": [
 +      "net.fabricmc.ExampleMod"
 +    ],
 +    "client": [
 +      "net.fabricmc.ExampleClientMod"
 +    ]
 +  }
 +  [...]
 +}
 +</code>
 +
 +By implementing Mod Initializer interfaces, you must implement an ''onInitializing()'' (or ''onInitializeClient()'' for Client, ''onInitializeServer()'' for Server) function. You can then write your codes there.
 +
 +Also, there is a block called ''initializers''.
  
 ==== Maven Group & Package Names ==== ==== Maven Group & Package Names ====
 According to Oracle's Java documentation, they are written in all lower case to avoid conflict with the names of classes or interfaces. The reverse of your domain name is used to start the names. Read more at [[https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html]]. According to Oracle's Java documentation, they are written in all lower case to avoid conflict with the names of classes or interfaces. The reverse of your domain name is used to start the names. Read more at [[https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html]].
tutorial/terms.txt · Last modified: 2022/12/22 18:51 by basil4088