User Tools

Site Tools


tutorial:registry

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
tutorial:registry [2024/08/25 14:03] – [Registry entry] solidblocktutorial:registry [2024/08/25 14:06] (current) solidblock
Line 93: Line 93:
   * ''%%/loot give @s loot {pools:[{rolls:1, entries:[{type:"item", name:"minecraft:stone"}]}]}%%''   * ''%%/loot give @s loot {pools:[{rolls:1, entries:[{type:"item", name:"minecraft:stone"}]}]}%%''
  
-Both the two commands give you a stone. The former one will get the loot table ''minecraft:blocks/stone'' from the loot table registry of the world, so it is ''RegistryEntry.Reference''. The latter one will encode a loot table from a SNBT, which does not have an ID, so it is ''RegistryEntry.Direct''. Both the two type of registry entries can be fetched the actual content by calling ''value()'' method.+Both the two commands give you a stone. The former one will get the loot table ''minecraft:blocks/stone'' from the loot table registry of the world, so it is ''RegistryEntry.Reference''. The latter one will decode a loot table from a SNBT, which does not have an ID, so it is ''RegistryEntry.Direct''. Both the two type of registry entries can be fetched the actual content by calling ''value()'' method.
  
 ==== Registry entry list ==== ==== Registry entry list ====
  
-Similar to registry entries, **registry entry lists** (''RegistryEntryList'') are used in many cases and have two types:+Similar to registry entries, **registry entry lists** (''RegistryEntryList'') are used in many cases and also have two types:
   * ''RegistryEntryList.Named'': The list defined by [[tags]], which are defined in data packs.   * ''RegistryEntryList.Named'': The list defined by [[tags]], which are defined in data packs.
   * ''RegistryEntryList.Direct'': The list defirectly defined by listing all contents.   * ''RegistryEntryList.Direct'': The list defirectly defined by listing all contents.
tutorial/registry.1724594586.txt.gz · Last modified: 2024/08/25 14:03 by solidblock