PetarLib Documentation

website·Indexed 31 days ago

https://docs.petarmc.com/

A library for Minecraft mod development providing utilities for task scheduling, asynchronous HTTP requests via a Java HttpClient wrapper, regex-based chat message matching, in-game notifications, and a performant logging system. Available for both Fabric and Bukkit/Spigot/Paper environments.

Tokens
16.6K
Snippets
110
Records
172
Agent score
49%

What's inside PetarLib

  1. Overview of the Fish Tracker Backend API

    The Fish Tracker Backend API is a Node.js and Express application using MongoDB. It serves as the data management system for tracking fish and crab data across various Minecraft gamemodes (OneBlock, Earth, Survival, and Factions) on the CosmosMc server. The API is divided into three primary access levels: Public Access (demo and user-specific data), User Management (authentication and data operations), and an Admin Panel (system statistics and administrative controls).
  2. Overview of PetarLib utility library

    PetarLib is a utility library mod for Minecraft Fabric designed to provide common functionalities for mods. It includes built-in systems for logging, chat message processing, HTTP requests, task scheduling, and in-game notifications.
  3. Overview of PetarLib-Bukkit utility library

    PetarLib is a utility library plugin designed to provide common functionalities and listeners for plugins developed by Petar_mc. Key features include:

    • In-game notifications via chat and action bars.
    • An HTTP Client Wrapper around Java's HttpClient featuring retry logic and asynchronous support.
    • A Task Scheduling system for running tasks asynchronously or with delays, including built-in exception handling.
  4. Overview of PetarMC Projects

    PetarMC maintains several Minecraft-related projects including the Fish Tracker (and its associated mod) for CosmosMC, PetarLib (a library for Minecraft mods), PetarLib for Bukkit (a library for plugins), the Minecraft Items API v2, and a Duration Parser.
  5. Overview of Duration Parser Java library

    Duration Parser is a Java utility library located in the com.petarmc.durationparser package. It wraps Java's java.time.Duration class to provide easy parsing and formatting of human-readable duration strings. Key capabilities include:

    • Case-insensitive parsing of strings like "1d 2h 3m 4s" or "2 hours 30 minutes".
    • Support for multiple time units: days, hours, minutes, and seconds (including various abbreviations).
    • Input validation to prevent negative durations.
    • Formatting durations into short, compact, or long human-readable strings.
  6. Introduction to FishTracker for CosmosMc

    FishTracker is a Minecraft Fabric mod designed for the CosmosMc server. It automatically tracks caught fish by parsing in-game chat messages to detect catches and their rarity. The captured data is then securely transmitted to a remote API for statistics and analysis using Fernet encryption.
  7. Frontend technology stack for Fish Tracker

    The Fish Tracker frontend is built using the following core technologies for styling, animation, and iconography: Tailwind CSS for styling, Framer Motion for animations, and React Icons for the icon library.
  8. Fish Tracker Backend Database Architecture Overview

    The Fish Tracker Backend API uses a MongoDB architecture where all data resides within a single MongoDB database instance. Core user and admin data are stored in shared collections, while fish and crab data are isolated into per-user, per-gamemode collections to ensure data separation.
  9. Retrieve Minecraft block information by name or ID

    Use these endpoints to get details about Minecraft blocks for a specific game version. You can query by the block's name or its unique ID.

    GET /v1/name/blocks/{version}/{blockName} GET /v1/id/blocks/{version}/{blockId}