Welcome to frmcLib’s documentation!

Here you can find all the explanations about my project, available on Github.

This Python library aims to retrieve all Minecraft® game information from the large database at fr-minecraft.net. Unfortunately this site does not have any API, so the library uses the html code of pages to navigate and do research, in a reasonable time.

Currently not a lot of content is supported by the frmcLib library, but I am constantly working on improving it. You will soon have access to potion effects, enchantments… but also to tips, maps, wallpapers, and other content posted (in French) on the site. And all this with an amazing facility! A single line of code is enough to retrieve all the information about the Slime, or many other items and entities!

In addition the other internal functions stay available and well documented, which allows you for example to find all the files corresponding to any word (all the swords of the game for example).

If you want to report bugs or improve the library, feel free to go to the Github page of the project, or to send me an email.

If you want to install this library, just enter pip3 install git+https://github.com/ZRunner/fr-mc-python-lib in a terminal, then import frmc_lib in your python file.

Generalities

Some functions are common to several (or all) classes, and are used to avoid copy and paste in the codes of each class. They are used automatically by the library, especially in the main() function, but you can also use them yourself in your code.

You will also find on this page a summary of each class that can be returned to you by the main() function, each corresponding to a type of content (entity, item, command…)

This library depends on regex library to find the information in the html code, and requests to get the code from each page.

Note

All given information come directly from the site fr-minecraft.net !

Warning

Some information can be empty, depending on the entities: an xp orb will have no dimensions, or life points!

Classes used

Entity

This class represents an entity of the Minecraft game, and several information about it. You will find in particular:

  • His name, in French

  • A list of its identifiers (text), according to the different versions of the game

  • Its type (passive, hostile…)

  • Its points of attack and life

  • An url to an image representing it (in png)

Item

This class represents an item or a block. As for the other classes, you will find there several information, such as :

  • A list of identifiers (text and sometimes numeric) according to the different versions of the game

  • The size of a stack of this object (1 for tools, 16 for snowballs…)

  • The tab where the item is in creative mode

  • The version of the game where the item was added

  • A list of mobs that can drop this item

Command

This class represent a command (sometimes also called cheat). Here is the very long list of all available information :

  • The name of the command (the thing right after the slash)

  • Syntax, in the form of a list of parameters

  • Some examples to understand the use

  • The version of the game where the item was added

Advancement

This class represents an advancement, the event that replaces achievements since Minecraft Java Edition 1.12. For those who are lazy enough to click on the word Advancement, here is a list of information retrieved by the library :

  • The name of the advancement

  • The type of the advancement (Progrès/Objectif)

  • The previous and next advancement(s) in the Tree structure

  • The url of the advancement page

  • and some other information

Main function

Search function

Miscellaneous functions

Url to data

Searching item function

Miscellaneous constants

Note

These constants will probably never be useful to you; nevertheless they are an integral part of the library, so I preferred to indicate them here.

regex_version: The regex string used to retrieve the item version (one of the few that are common to almost all items)

regex_version = r'<div class=\"version\">[^<]+<br/>\s*<[^>]+>\s*([^<\n\r]+)\s*</a>'

timeout: When searching for the html version of a page, this is the maximum time, in seconds, the program waits before raising an exception requests.Timeout.

timeout = 5

Some errors

MissingLibError

ItemNotFoundError

WrongDataError

Items & Blocks

The blocks are the essence of Minecraft. This cubist world being essentially composed of blocks, it is unthinkable that the library does not propose to collect information on them. By the same method, you will find information on the different items of the game, such as tools, food, etc.

The information provided is quite diverse, and the Item class is flexible enough to adapt to each type of item : for a weapon you will find its durability and its attack points; for a block you will have the type of tool capable of breaking it ; for others you will get a list of mobs that could potentially drop this item, or the name of the creative mode tab… all this always retrieved directly from the site fr-minecraft.net !

The class

When you search with the search_item() function, you get an Item object that summarizes all the characteristics of the item (or the block). The details of this class are explained here:

Entities

Entities form a significant part of Minecraft’s cubic world. That’s why this library makes it easy to retrieve much of the information about any entity in the game. From the famous creeper to the orbe of xp, passing through the armor stands and the slimes, you can find their identifiers, their life points, the number of xp dropped to death, a link to an image representing the entity (png)… All taken directly from the site fr-minecraft.net !

The class

When you search with the search_entity() function, you get an Entity object that summarizes all the characteristics of the entity. The details of this class are explained here:

Commands

Minecraft commands are kind of the hidden part of the game. They do a lot of things, really a lot. From simple teleporting to the creation of new gameplays, as well as counting statistics or placing blocks, the possibilities are almost infinite to who knows how to use them. This is why the library proposes to display for each command its syntax caption, and some examples to understand well.

Again here all information is directly retrieved from the fr-minecraft.net site, so it is possible to have a latency time between the game update and the library update.

The class

When you search with the search_cmd() function, you get an Command object that summarizes all the characteristics of the command. The details of this class are explained here:

Advancements

Advancements are rewards earned when you do certain actions during your Minecraft game. They can help you progress in the game, giving you goals, quests, and sometimes with a small reward at stake. Advancements also replace the achievements, which were removed in Minecraft version 1.12. This library offers you to retrieve some details about these new advancements, such as their place in the general tree structure, or the way to get them. It’s up to you how to use this information wisely!

And like the other objects, the advancements come from the site fr-minecraft.net. Most of the texts are therefore in French.

The class

When you search with the search_adv() function, you get an Advancement object that summarizes all the characteristics of the advancement. The details of this class are explained here:

Indices and tables