User Tools

Site Tools


tutorial:custom_resources

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
tutorial:custom_resources [2025/06/08 17:23] – [Reload Listeners 2: The Listener] Fix wrong code in manager.findResources inteziumtutorial:custom_resources [2026/11/19 06:19] (current) – fix typo mcgambingpro
Line 13: Line 13:
 Any and all work you plan to do regarding resources must be registered through ''ResourceManagerHelper'', or more specifically, one of its resource types through ''ResourceManagerHelper#get(ResourceType)'', where the type can be either ''SERVER_DATA'' or ''CLIENT_RESOURCES'', corresponding to data pack and resource pack resources respectively, or in a dev env, the files found within the ''resources/assets'' and ''resources/data'' folders respectively (in case you are wondering, yes, your mod's assets and data are handled in the same way as resource packs and data packs internally, so this will also handle anything put in there). Any and all work you plan to do regarding resources must be registered through ''ResourceManagerHelper'', or more specifically, one of its resource types through ''ResourceManagerHelper#get(ResourceType)'', where the type can be either ''SERVER_DATA'' or ''CLIENT_RESOURCES'', corresponding to data pack and resource pack resources respectively, or in a dev env, the files found within the ''resources/assets'' and ''resources/data'' folders respectively (in case you are wondering, yes, your mod's assets and data are handled in the same way as resource packs and data packs internally, so this will also handle anything put in there).
  
-From here on forward, examples will be centered around data packs and use ''ResourceType.SERVER_DATA'' were applicable, do remember that the process for data and resource pack resource processing is the same except for what ''ResourceType'' is being called.+From here on forward, examples will be centered around data packs and use ''ResourceType.SERVER_DATA'' where applicable, do remember that the process for data and resource pack resource processing is the same except for what ''ResourceType'' is being called.
  
 Continuing on the registry side of things, registering your reload listener is done through ''ResourceManagerHelper#get(ResourceType).registerReloadListener(IdentifiableResourceReloadListener)''. Notably once registered your listener will not only handle the initial load of resources, but any subsequent reloads such as those done by ''/reload'' and ''F3 + T'' Continuing on the registry side of things, registering your reload listener is done through ''ResourceManagerHelper#get(ResourceType).registerReloadListener(IdentifiableResourceReloadListener)''. Notably once registered your listener will not only handle the initial load of resources, but any subsequent reloads such as those done by ''/reload'' and ''F3 + T''
tutorial/custom_resources.txt · Last modified: by mcgambingpro