forked from SpockBotMC/python-minecraft-data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
27 lines (19 loc) · 728 Bytes
/
example.py
File metadata and controls
27 lines (19 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import minecraft_data
# Java edition minecraft-data
mcd = minecraft_data("1.21.3")
print(mcd.version)
print(mcd.find_item_or_block(1))
print(mcd.find_item_or_block('stone'))
print(mcd.recipes['5'][0])
print(mcd.windows['minecraft:brewing_stand'])
print(mcd.effects_name['Haste'])
# Bedrock Edition minecraft-data
mcd_pe = minecraft_data("1.21.70", "bedrock")
print(mcd_pe.version)
print(mcd_pe.find_item_or_block('stone'))
# Query common data. E.g. to map the protocol version to a minecraft version
protocol_version = 754 # example protocol version
for version in minecraft_data.common().protocolVersions:
if version["version"] == protocol_version:
print(version["minecraftVersion"]) # 1.16.5
break