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 revision Previous revision
Next revision
Previous revision
tutorial:terms [2019/08/14 04:49]
shedaniel
tutorial:terms [2020/02/23 22:32] (current)
earthcomputer [Entry Points and Initializers] Mod initializers are not technically required
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 usually contains 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.1565758190.txt.gz ยท Last modified: 2019/08/14 04:49 by shedaniel