Cold Sweat
  • Temperature Basics
  • TempModifiers
  • List of TempModifiers
  • Block Temperature
  • Attributes
  • Tags
    • Item Tags
    • Block Tags
    • Dimension Type Tags
    • Potion Effect Tags
  • Datapacks
    • Datapack Basics
    • Requirements
      • Entity Requirement
      • Item Requirement
      • Block Requirement
      • NBT Requirement
      • Components Requirement
      • Location Requirement
    • Item Configs
    • Block/World Configs
    • Entity Configs
    • Registry Removals
  • KubeJS
    • KubeJS Basics
    • Registries
      • Block Temperature
  • Add-Ons
    • Origin Configs
  • Utility Classes
    • DynamicHolder
    • CapabilityCache
Powered by GitBook
On this page
  1. Utility Classes

DynamicHolder

A DynamicHolder typically holds config setting data. It can be thought of a supplier that caches its own value upon being queried for the first time. They also support serialization/deserialization via NBT.

The value of a DynamicHolder is obtained via the following methods:

get()

Registry Access

Some holders that rely on Minecraft registries (biomes, dimensions, structures, etc.) require an instance of RegistryAccess in order to be retrieved, and will throw an error if one is not supplied:

get(RegistryAccess registryAccess)

An instance of RegistryAccess can be retrieved from any MinecraftServer, Entity, or Level object (if it is not on the client-side). In the event that none of these sources are available, Cold Sweat provides a method for obtaining an instance of RegistryAccess:

RegistryHelper.getRegistryAccess()

Using this method is generally discouraged, as it uses potentially unstable methods of retrieving a MinecraftServer or Level object from a static context. Only use if there is no alternative and you know what you are doing.

RegistryAccess is only reliably present after the integrated server has loaded. Attempting to retrieve it before this point could result in null.

PreviousOrigin ConfigsNextCapabilityCache

Last updated 5 months ago