Class ItemModels

java.lang.Object
com.github.darksoulq.abyssallib.server.resource.util.ItemModels

public final class ItemModels extends Object
Static factory utility for generating common Minecraft item model configurations.

This class provides methods to create standard Model assets using vanilla parent templates such as item/generated or item/handheld.

  • Method Details

    • generated

      public static Model generated(Namespace ns, String name, Texture layer0)
      Creates a standard "generated" item model (flat item).

      Typically used for simple items like materials, food, or GUI icons.

      Parameters:
      ns - The Namespace to register the model in.
      name - The name of the model file (without .json).
      layer0 - The base Texture to apply to the model.
      Returns:
      A configured Model instance.
    • handheld

      public static Model handheld(Namespace ns, String name, Texture layer0)
      Creates a "handheld" item model.

      Handheld models are rotated in the player's hand to look like a tool or weapon.

      Parameters:
      ns - The Namespace to register the model in.
      name - The name of the model file.
      layer0 - The base Texture for the tool/weapon.
      Returns:
      A configured Model instance with the handheld parent.
    • handheldRod

      public static Model handheldRod(Namespace ns, String name, Texture layer0)
      Creates a "handheld_rod" item model.

      Similar to handheld, but specifically used for fishing rods or similar tools.

      Parameters:
      ns - The Namespace to register the model in.
      name - The name of the model file.
      layer0 - The base Texture.
      Returns:
      A configured Model instance.
    • spawnEgg

      public static Model spawnEgg(Namespace ns, String name)
      Creates a model based on the vanilla spawn egg template.

      Note: This template typically relies on color tints to distinguish between mobs.

      Parameters:
      ns - The Namespace to register the model in.
      name - The name of the model file.
      Returns:
      A configured Model instance with the spawn egg parent.
    • layered

      public static Model layered(Namespace ns, String name, Texture... layers)
      Creates a layered "generated" model with multiple texture overlays.

      Useful for items with colorable layers, such as leather armor or potions. Textures are assigned to layer0, layer1, etc., in order.

      Parameters:
      ns - The Namespace to register the model in.
      name - The name of the model file.
      layers - A vararg array of Texture assets.
      Returns:
      A configured Model instance.
    • handheldLayered

      public static Model handheldLayered(Namespace ns, String name, Texture... layers)
      Creates a layered "handheld" model.

      Combines multi-texture layering with the handheld rotation logic.

      Parameters:
      ns - The Namespace to register the model in.
      name - The name of the model file.
      layers - A vararg array of Texture assets.
      Returns:
      A configured Model instance.
    • template

      public static Model template(Namespace ns, String name, String parent, Texture layer0)
      Creates a custom model using a specific parent template.
      Parameters:
      ns - The Namespace to register the model in.
      name - The name of the model file.
      parent - The namespaced ID of the parent model (e.g., "minecraft:item/bow").
      layer0 - The base Texture to apply.
      Returns:
      A configured Model instance.