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.
What's inside PetarLib
- 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).
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.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.
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.Overview of Duration Parser Java library
Duration Parser is a Java utility library located in the
com.petarmc.durationparserpackage. It wraps Java'sjava.time.Durationclass 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.
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.Overview of CosmosMC Fish Tracker Frontend
The CosmosMC Fish Tracker frontend is a web application designed to track and visualize fish and crab catches on the CosmosMC Minecraft server. It is built using Next.js and TypeScript.ModMenu support in PetarLib
PetarLib includes built-in support for ModMenu, allowing the library to be integrated and managed within the ModMenu interface.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.Secure data transmission with Fernet encryption
FishTracker uses Fernet encryption to protect user data during the sending process, ensuring secure transmission of caught fish data.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.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}