Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

wlwanpan/mcdata

Repository files navigation

mcdata

mcdata is a code generator tool for generating a package of go structs of minecraft data entities from minecraft-data.

Note: go 1.16 is required since this package relies on the go embeded package.

Usage

go run cmd/main.go gen --edition PC --version 1.8 --output out/entities

Note: the generated package name will be the output dir name. For example, running the above command will generate a package "entities" with the following files:

- src
 /out
 /entities
 /materials.go
 /items.go
 /recipes.go
 /version.go
 /foods.go
 /particles.go
 /instruments.go
 /protocol.go
 /biomes.go
 /enchantments.go
 /entities.go
 /blocks.go
 /blockCollisionShapes.go
 /language.go
 /mapIcons.go
 /effects.go
 /windows.go

effects.go

package entities
type Effects []struct {
	DisplayName string `json:"displayName"`
	ID int64 `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
}

Load your pre-generated go struct

effects := &entities.Effects{}
err := mcdata.LoadDataToStruct("pc", "1.8", "effects", effects)
if err != nil {
	...
}
...

About

Go struct code generator for easy access to Minecraft data

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /