item

package
v0.0.0-...-ed75f63 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Air = Item{Id: "minecraft:air"}

Functions

This section is empty.

Types

type AttributeModifiers

type AttributeModifiers struct {
	Modifiers     []Modifier `nbt:"modifier"`
	ShowInTooltip bool       `nbt:"show_in_tooltip"`
}

type BannerPattern

type BannerPattern struct {
	Color   string `nbt:"color"`
	Pattern any    `nbt:"pattern"`
}

type Bee

type Bee struct {
	EntityData         entity.LevelEntity `nbt:"entity_data"` // import cycle :(
	MinimumTicksInHive int32              `nbt:"min_ticks_in_hive"`
	TicksInHive        int32              `nbt:"ticks_in_hive"`
}

type BucketEntityData

type BucketEntityData struct {
	NoAI             bool    `nbt:"NoAI"`
	Silent           bool    `nbt:"Silent"`
	NoGravity        bool    `nbt:"NoGravity"`
	Glowing          bool    `nbt:"Glowing"`
	Invulnerable     bool    `nbt:"Invulnerable"`
	Health           float32 `nbt:"Health"`
	Age              int32   `nbt:"Age"`
	Variant          int32   `nbt:"Variant"`
	HuntingCooldown  int64   `nbt:"HuntingCooldown"`
	BucketVariantTag int32   `nbt:"BucketVariantTag"`
}

type CanDo

type CanDo struct {
	ShowInTooltip bool         `nbt:"show_in_tooltip"`
	State         any          `nbt:"state"`  // Have to put any cause theres an infinite amount of key value pairs there could be
	Blocks        any          `nbt:"blocks"` //Can be string, or list
	NBT           string       `nbt:"nbt"`
	Predicates    []Predicates `nbt:"predicates"`
}

Both CanBreak and CanPlace have the same contents so im using the same class

type ContainerLoot

type ContainerLoot struct {
	LootTable string `nbt:"loot_table"`
	Seed      int64  `nbt:"seed"`
}

type CreativeSlotLock

type CreativeSlotLock struct {
}

Do not add this tag at all if you don't need it!

type DataSlot

type DataSlot int8

func DataSlotFrom

func DataSlotFrom(network int32) DataSlot

func (DataSlot) Network

func (slot DataSlot) Network() int32

type Effect

type Effect struct {
	ID            string `nbt:"id"`
	Amplifier     int8   `nbt:"amplifier"`
	Duration      int32  `nbt:"duration"`
	Ambient       bool   `nbt:"ambient"`
	ShowParticles bool   `nbt:"show_particles"`
	ShowIcon      bool   `nbt:"show_icon"`
}

type Effects

type Effects struct {
	Effect      Effect  `nbt:"effect"`
	Probability float32 `nbt:"probability"`
}

type Enchantments

type Enchantments struct {
	ShowInTooltip bool `nbt:"show_in_tooltip"`
	Levels        any  `nbt:"levels"`
}

type EntityData

type EntityData struct {
	EntityData entity.LevelEntity `nbt:"minecraft:entity_data"` // NBT
}

type Explosion

type Explosion struct {
	Shape      string  `nbt:"shape"`
	Colors     []int32 `nbt:"colors"`
	FadeColors []int32 `nbt:"fade_colors"`
	HasTrail   bool    `nbt:"has_trail"`
	HasTwinkle bool    `nbt:"has_twinkle"`
}

type FireResistant

type FireResistant struct {
}

Do not add this tag at all if you don't want it to be fire resistant!

type FireworkExplosion

type FireworkExplosion struct {
	Shape      string  `nbt:"shape"`
	Colors     []int32 `nbt:"colors"`
	FadeColors []int32 `nbt:"fade_colors"`
	HasTrail   bool    `nbt:"has_trail"`
	HasTwinkle bool    `nbt:"has_twinkle"`
}

type Fireworks

type Fireworks struct {
	FlightDuration int8        `nbt:"flight_duration"`
	Explosions     []Explosion `nbt:"explosions"`
}

type Food

type Food struct {
	Nutrition       int32    `nbt:"nutrition"`
	Saturation      float32  `nbt:"saturation"`
	CanAlwaysEat    bool     `nbt:"can_always_eat"`
	EatSeconds      float32  `nbt:"eat_seconds"`
	UsingConvertsTo Item     `nbt:"using_converts_to"`
	Effects         []Effect `nbt:"effects"`
}

type HideAdditionalTooltip

type HideAdditionalTooltip struct {
}

Do not add this tag at all if you don't want it to hide additional tooltip(s)!

type HideTooltip

type HideTooltip struct {
}

Do not add this tag at all if you don't want it to hide the tooltip!

type IntangibleProjectile

type IntangibleProjectile struct {
}

Do not add this tag at all if you don't want it to intangible!

type Item

type Item struct {
	// The slot (as stored in the player data)
	Slot DataSlot `nbt:"Slot"`
	// the amount of items in the slot
	Count int32 `nbt:"count"`
	// The string id of this item
	Id string `nbt:"id"`
	// Components of this item (https://minecraft.wiki/w/Data_component_format#List_of_components)
	Components struct{} `nbt:"components"` /*struct {
		AttributeModifiers       any                      `nbt:"minecraft:attribute_modifiers"`
		BannerPatterns           []BannerPattern          `nbt:"minecraft:banner_patterns"`
		BaseColor                string                   `nbt:"minecraft:base_color"`
		Bees                     []Bee                    `nbt:"minecraft:bees"`
		BlockEntityData          any                      `nbt:"minecraft:block_entity_data"`
		BlockState               any                      `nbt:"minecraft:block_state"`
		BucketEntityData         BucketEntityData         `nbt:"minecraft:bucket_entity_data"`
		BundleContents           []Item                   `nbt:"minecraft_bundle_contents"`
		CanBreak                 CanDo                    `nbt:"minecraft:can_break"`
		CanPlaceOn               CanDo                    `nbt:"minecraft:can_place_on"`
		ChargedProjectiles       []Item                   `nbt:"minecraft:charged_projectiles"`
		Container                []Item                   `nbt:"minecraft:container"`
		ContainerLoot            ContainerLoot            `nbt:"minecraft_container_loot"`
		CustomData               any                      `nbt:"minecraft:custom_data"`
		CustomModelData          int32                    `nbt:"minecraft:custom_model_data"`
		CustomName               string                   `nbt:"minecraft:custom_name"`
		Damage                   int32                    `nbt:"minecraft:damage"`
		DebugStickState          any                      `nbt:"minecraft:debug_stick_state"`
		DyedColor                any                      `nbt:"minecraft:dyed_color"`
		EnchantmentGlintOverride bool                     `nbt:"minecraft:enchantment_glint_override"`
		Enchantments             Enchantments             `nbt:"minecraft:enchantments"`
		EntityData               state.LevelEntity       `nbt:"minecraft:entity_data"`
		FireResistant            FireResistant            `nbt:"minecraft:fire_resistant"`
		FireworkExplosion        FireworkExplosion        `nbt:"minecraft:firework_explosion"`
		Fireworks                Fireworks                `nbt:"minecraft:fireworks"`
		Food                     Food                     `nbt:"minecraft:food"`
		HideAdditionalTooltip    HideAdditionalTooltip    `nbt:"minecraft:hide_additional_tooltip"`
		HideTooltip              HideTooltip              `nbt:"minecraft:hide_tooltip"`
		Instrument               any                      `nbt:"minecraft:instrument"`
		IntangibleProjectile     IntangibleProjectile     `nbt:"minecraft:intangible_projectile"`
		ItemName                 string                   `nbt:"minecraft:item_name"`
		JukeboxPlayable          JukeboxPlayable          `nbt:"minecraft:jukebox_playable"`
		Lock                     string                   `nbt:"minecraft:lock"`
		LodestoneTracker         LodestoneTracker         `nbt:"minecraft:lodestone_tracker"`
		Lore                     []string                 `nbt:"minecraft:lore"`
		MapColor                 int32                    `nbt:"minecraft:map_color"`
		MapDecorations           any                      `nbt:"minecraft:map_decorations"`
		MapID                    int32                    `nbt:"minecraft:map_id"`
		MaxDamage                int32                    `nbt:"minecraft:max_damage"`
		MaxStackSize             int32                    `nbt:"minecraft:max_stack_size"`
		NoteBlockSound           string                   `nbt:"minecraft:note_block_sound"`
		OminousBottleAmplifier   int32                    `nbt:"minecraft:ominous_bottle_amplifier"`
		PotDecorations           []string                 `nbt:"minecraft:pot_decorations"`
		PotionContents           any                      `nbt:"minecraft:potion_contents"`
		Profile                  any                      `nbt:"minecraft:profile"`
		Rarity                   string                   `nbt:"minecraft:rarity"`
		Recipes                  []string                 `nbt:"minecraft:recipes"`
		RepairCost               int32                    `nbt:"minecraft:repair_cost"`
		StoredEnchantments       StoredEnchantments       `nbt:"minecraft:stored_enchantments"`
		SuspiciousStewEffects    []SuspiciousStewEffect   `nbt:"minecraft:suspicious_stew_effects"`
		Tool                     Tool                     `nbt:"minecraft:tool"`
		Trim                     Trim                     `nbt:"minecraft:trim"`
		Unbreakable              Unbreakable              `nbt:"minecraft:unbreakable"`
		WritableBookContent      WritableBookContent      `nbt:"minecraft:writable_book_content"`
		WrittenBookContent       WrittenBookContent       `nbt:"minecraft:written_book_content"`
		CreativeSlotLock         CreativeSlotLock         `nbt:"minecraft:creative_slot_lock"`
		MapPostProcessing        int32                    `nbt:"minecraft:map_post_processing"`
	} `nbt:"components"`*/
}

func New

func New(slot int32, item slot.Slot) (Item, error)

New creates an item from the slot provided

func (Item) Block

func (i Item) Block() (block section.Block, ok bool)

returns the block of the item, if found

func (*Item) Is

func (item *Item) Is(i Item) bool

func (*Item) IsTag

func (item *Item) IsTag(tagName string) bool

Is checks if the tag applies to the item

type JukeboxPlayable

type JukeboxPlayable struct {
	Song          string `nbt:"song"`
	ShowInTooltip bool   `nbt:"show_in_tooltip"`
}

type LodestoneTracker

type LodestoneTracker struct {
	Target  Target `nbt:"target"`
	Tracked bool   `nbt:"tracked"`
}

type MapPostProcessing

type MapPostProcessing struct {
	MapPostProcessing int32 `nbt:"map_post_processing"`
}

type Modifier

type Modifier struct {
	Type     string            `nbt:"type"`
	Slot     string            `nbt:"slot"`
	Id       string            `nbt:"id"`
	Amount   float64           `nbt:"amount"`
	Operator ModifierOperation `nbt:"operation"`
}

type ModifierOperation

type ModifierOperation string
const (
	AddValue           ModifierOperation = "add_value"
	AddMultipliedBase  ModifierOperation = "add_multiplied_base"
	AddMultipliedTotal ModifierOperation = "add_multiplied_total"
)

type Predicates

type Predicates struct {
	State  any    `nbt:"state"`
	Blocks any    `nbt:"blocks"`
	NBT    string `nbt:"nbt"`
}

type Rule

type Rule struct {
	Blocks          any     `nbt:"blocks"`
	Speed           float32 `nbt:"speed"`
	CorrectForDrops bool    `nbt:"correct_for_drops"`
}

type StoredEnchantments

type StoredEnchantments struct {
	Levels        any  `nbt:"levels"`
	ShowInTooltip bool `nbt:"show_in_tooltip"`
}

type SuspiciousStewEffect

type SuspiciousStewEffect *struct {
	ID       string `nbt:"id"`
	Duration int32  `nbt:"duration"`
}

type Target

type Target struct {
	Pos       []int32 `nbt:"pos"`
	Dimension string  `nbt:"dimension"`
}

type Title

type Title struct {
	Raw      string `nbt:"raw"`
	Filtered string `nbt:"filtered"`
}

type Tool

type Tool struct {
	DefaultMiningSpeed float32 `nbt:"default_mining_speed"`
	DamagePerBlock     int32   `nbt:"damage_per_block"`
	Rules              []Rule  `nbt:"rules"`
}

type Trim

type Trim struct {
	Pattern       string `nbt:"pattern"`
	Material      string `nbt:"material"`
	ShowInTooltip bool   `nbt:"show_in_tooltip"`
}

type Unbreakable

type Unbreakable struct {
	ShowInTooltip bool `nbt:"show_in_tooltip"`
}

type WritableBookContent

type WritableBookContent struct {
	Pages any `nbt:"pages"`
}

type WrittenBookContent

type WrittenBookContent struct {
	Pages      any    `nbt:"pages"`
	Title      Title  `nbt:"title"`
	Author     string `nbt:"author"`
	Generation int32  `nbt:"generation"`
	Resolved   bool   `nbt:"resolved"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳