rstem.mcpi.event module
from .vec3 import Vec3
class BlockEvent:
"""An Event related to blocks (e.g. placed, removed, hit)"""
HIT = 0
def __init__(self, type, x, y, z, face, entityId):
self.type = type
self.pos = Vec3(x, y, z)
self.face = face
self.entityId = entityId
def __repr__(self):
sType = {
BlockEvent.HIT: "BlockEvent.HIT"
}.get(self.type, "???")
return "BlockEvent(%s, %d, %d, %d, %d, %d)"%(
sType,self.pos.x,self.pos.y,self.pos.z,self.face,self.entityId);
@staticmethod
def Hit(x, y, z, face, entityId):
return BlockEvent(BlockEvent.HIT, x, y, z, face, entityId)
Classes
class BlockEvent
An Event related to blocks (e.g. placed, removed, hit)
class BlockEvent:
"""An Event related to blocks (e.g. placed, removed, hit)"""
HIT = 0
def __init__(self, type, x, y, z, face, entityId):
self.type = type
self.pos = Vec3(x, y, z)
self.face = face
self.entityId = entityId
def __repr__(self):
sType = {
BlockEvent.HIT: "BlockEvent.HIT"
}.get(self.type, "???")
return "BlockEvent(%s, %d, %d, %d, %d, %d)"%(
sType,self.pos.x,self.pos.y,self.pos.z,self.face,self.entityId);
@staticmethod
def Hit(x, y, z, face, entityId):
return BlockEvent(BlockEvent.HIT, x, y, z, face, entityId)
Ancestors (in MRO)
- BlockEvent
- builtins.object
Class variables
var HIT
Static methods
def __init__(
self, type, x, y, z, face, entityId)
def __init__(self, type, x, y, z, face, entityId):
self.type = type
self.pos = Vec3(x, y, z)
self.face = face
self.entityId = entityId
def Hit(
x, y, z, face, entityId)
@staticmethod
def Hit(x, y, z, face, entityId):
return BlockEvent(BlockEvent.HIT, x, y, z, face, entityId)
Instance variables
var entityId
var face
var pos
var type