BowStateDetector

public final class BowStateDetector

Detects bow and crossbow draw state model groups and generates the appropriate conditional item definition JSON for Minecraft's resource pack system.

Naming convention:

  • {name}_idle — in hand, not drawing
  • {name}_draw_start — just started pulling
  • {name}_draw_half — halfway drawn
  • {name}_draw_full — fully drawn
  • {name}_charged — loaded crossbow (crossbow only)

Types

Link copied to clipboard
public final class StateGroup extends Record
Represents a detected bow or crossbow state group.

Properties

Link copied to clipboard
public final static List<String> ALL_STATE_SUFFIXES

Functions

Link copied to clipboard
public static List<BowStateDetector.StateGroup> detectStateGroups(Set<String> displayModelIds)
Scans a set of model IDs that have display JSONs and detects bow/crossbow groups.
Link copied to clipboard
public static String generateBowItemJson(String baseName, String namespace)
Generates the conditional item definition JSON for a bow state group.
Link copied to clipboard
public static String generateCrossbowItemJson(String baseName, String namespace)
Generates the conditional item definition JSON for a crossbow state group.
Link copied to clipboard
public static boolean isDrawStateSuffix(String modelId)
Checks if a model ID has a bow/crossbow draw state suffix.
Link copied to clipboard
public static String stripStateSuffix(String modelId)
Strips the draw state suffix from a model ID to get the base name.