Categorygithub.com/venitynetwork/vhandler
modulepackage
0.0.0-20241104155607-0a733b0e45ce
Repository: https://github.com/venitynetwork/vhandler.git
Documentation: pkg.go.dev

# README

vhandler

A dragonfly functional event handler.

For now, the documentation is not complete. Please refer to the source code for more information.

Installation

go get github.com/venitynetwork/vhandler

Usage

func setupHandler() *vhandler.PlayerHandlers {
    h := vhandler.NewPlayerHandlers()
    h.OnAttackEntity(func (p *player.Player, ctx *event.Context, e world.Entity, force *float64, height *float64, critical *bool) {
        fmt.Printf("%s attacked %v\n", p.Name(), e)
    }, vhandler.PriorityNormal)
    
    h.OnBlockBreak(func (p *player.Player, ctx *event.Context, pos cube.Pos, drops *[]item.Stack, xp *int) {
        fmt.Printf("%s broke a block at %v\n", p.Name(), pos)
    }, vhandler.PriorityLow)
	
    return h
}

func setPlayerHandler(p *player.Player){
    h := setupHandler()
    // Note: h can be reused for multiple players
    vhandler.HandlePlayer(p, h)
}

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Priority represents the priority of a handler.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author