creative

package
v0.10.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 7 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterGroup added in v0.10.2

func RegisterGroup(group Group)

RegisterGroup registers a group as a creative group, exposing it in the creative inventory. It can then be referenced using its name when calling RegisterItem.

func RegisterItem

func RegisterItem(item Item)

RegisterItem registers an item as a creative item, exposing it in the creative inventory.

Types

type Category added in v0.10.2

type Category struct {
	// contains filtered or unexported fields
}

Category represents a category of items in the creative inventory which are shown as different tabs.

func ConstructionCategory added in v0.10.2

func ConstructionCategory() Category

ConstructionCategory is the construction category which contains only blocks that do not fall under any other category.

func EquipmentCategory added in v0.10.2

func EquipmentCategory() Category

EquipmentCategory is the equipment category which contains tools, armour, food and any other form of equipment.

func ItemsCategory added in v0.10.2

func ItemsCategory() Category

ItemsCategory is the items category for all the miscellaneous items that do not fall under any other category.

func NatureCategory added in v0.10.2

func NatureCategory() Category

NatureCategory is the nature category which contains blocks and items that can be naturally found in the world.

func (Category) Uint8 added in v0.10.2

func (s Category) Uint8() uint8

Uint8 returns the category type as a uint8.

type Group added in v0.10.2

type Group struct {
	// Category is the category of the group. It determines the tab in which the group will be displayed in the
	// creative inventory.
	Category Category
	// Name is the localised name of the group, i.e. "itemGroup.name.planks".
	Name string
	// Icon is the item that will be displayed as the icon of the group in the creative inventory.
	Icon item.Stack
}

Group represents a group of items in the creative inventory. Each group has a category, a name and an icon. If either the name or icon is empty, the group is considered an 'anonymous group' and will not group its contents together in the creative inventory.

func Groups added in v0.10.2

func Groups() []Group

Groups returns a list with all groups that have been registered as a creative group. These groups will be accessible by players in-game who have creative mode enabled.

type Item added in v0.10.2

type Item struct {
	// Stack is the stack of the item that is registered in the creative inventory.
	Stack item.Stack
	// Group is the name of the group that the item is part of. If two groups are registered with the same
	// name, the item will always reside in the first group that was registered.
	Group string
}

Item represents a registered item in the creative inventory. It holds a stack of the item and a group that the item is part of.

func Items

func Items() []Item

Items returns a list with all items that have been registered as a creative item. These items will be accessible by players in-game who have creative mode enabled.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL