Block entities are simply blocks in the world that have persistent data, such as the text for a sign
or contents of a chest. All block entities are also saved in the chunk data of the chunk they reside in.
The cBlockEntity class acts as a common ancestor for all the individual block entities.
]],
Functions=
{
GetBlockType={Params="",Return="BLOCKTYPE",Notes="Returns the blocktype which is represented by this blockentity. This is the primary means of type-identification"},
GetChunkX={Params="",Return="number",Notes="Returns the chunk X-coord of the block entity's chunk"},
GetChunkZ={Params="",Return="number",Notes="Returns the chunk Z-coord of the block entity's chunk"},
IsMineralBlock={Params="BLOCKTYPE",Return="bool",IsStatic=true,Notes="Returns true if the block is a diamond block, a golden block, an iron block or an emerald block."},
IsValidEffect={Params="{{cEntityEffect#eType|EffectType}}, BeaconLevel",Return="boolean",IsStatic=true,Notes="Returns true if the effect can be used."},
SetPrimaryEffect={Params="{{cEntityEffect#eType|EffectType}}",Return="bool",Notes="Select the primary effect. Returns false when the effect is invalid."},
SetSecondaryEffect={Params="{{cEntityEffect#eType|EffectType}}",Return="bool",Notes="Select the secondary effect. Returns false when the effect is invalid."},
GetShootVector={Params="BlockMeta",Return="{{Vector3d}}",IsStatic=true,Notes="Returns a unit vector in the cardinal direction of where the dispenser with the specified meta would be facing."},
SpawnProjectileFromDispenser={Params="BlockX, BlockY, BlockZ, {{cProjectileEntity#eKind|Kind}}, Speed, {{cItem|Item}}",Return="number",Notes="Spawns a projectile of the given kind in front of the dispenser with the specified speed. Returns the UniqueID of the spawned projectile, or {{cEntity#INVALID_ID|cEntity.INVALID_ID}} on failure."},
This class represents a dropper block entity in the world. Most of this block entity's functionality
is implemented in the {{cDropSpenserEntity|cDropSpenserEntity}} class that represents the behavior
common with the {{cDispenserEntity|dispenser}} entity.</p>
<p>
An object of this class can be created from scratch when generating chunks ({{OnChunkGenerated|OnChunkGenerated}} and {{OnChunkGenerating|OnChunkGenerating}} hooks).
This is a class that implements behavior common to both {{cDispenserEntity|dispensers}} and {{cDropperEntity|droppers}}.
]],
Functions=
{
Activate={Params="",Return="",Notes="Sets the block entity to dropspense an item in the next tick"},
AddDropSpenserDir={Params="BlockX, BlockY, BlockZ, BlockMeta",Return="BlockX, BlockY, BlockZ",Notes="Adjusts the block coords to where the dropspenser items materialize"},
SetRedstonePower={Params="IsPowered",Return="",Notes="Sets the redstone status of the dropspenser. If the redstone power goes from off to on, the dropspenser will be activated"},
},
Constants=
{
ContentsWidth={Notes="Width (X) of the {{cItemGrid}} representing the contents"},
ContentsHeight={Notes="Height (Y) of the {{cItemGrid}} representing the contents"},
This class represents a hopper block entity in the world.
]],
Functions=
{
GetOutputBlockPos={Params="BlockMeta",Return="bool, BlockX, BlockY, BlockZ",Notes="Returns whether the hopper is attached, and if so, the block coords of the block receiving the output items, based on the given meta."},
},
Constants=
{
ContentsHeight={Notes="Height (Y) of the internal {{cItemGrid}} representing the hopper contents."},
ContentsWidth={Notes="Width (X) of the internal {{cItemGrid}} representing the hopper contents."},
TICKS_PER_TRANSFER={Notes="Number of ticks between when the hopper transfers items."},
EjectRecord={Params="",Return="bool",Notes="Ejects the current record as a {{cPickup|pickup}}. No action if there's no current record. To remove record without generating the pickup, use SetRecord(0). Returns true if pickup ejected."},
IsPlayingRecord={Params="",Return="bool",Notes="Returns true if the jukebox is playing a record."},
IsRecordItem={Params="ItemType",Return="bool",Notes="Returns true if the specified item is a record that can be played."},
PlayRecord={Params="RecordItemType",Return="bool",Notes="Plays the specified Record. Return false if the parameter isn't a playable Record (E_ITEM_XXX_DISC). If there is a record already playing, ejects it first."},
SpawnEntity={Params="",Return="",Notes="Spawns the entity. This function automaticly change the spawn delay!"},
UpdateActiveState={Params="",Return="",Notes="Upate the active flag from the mob spawner. This function will called every 5 seconds from the Tick() function."},
This class represents a note block entity in the world. It takes care of the note block's pitch,
and also can play the sound, either when the {{cPlayer|player}} right-clicks it, redstone activates
it, or upon a plugin's request.</p>
<p>
The pitch is stored as an integer between 0 and 24.
]],
Functions=
{
GetPitch={Params="",Return="number",Notes="Returns the current pitch set for the block"},
IncrementPitch={Params="",Return="",Notes="Adds 1 to the current pitch. Wraps around to 0 when the pitch cannot go any higher."},
MakeSound={Params="",Return="",Notes="Plays the sound for all {{cClientHandle|clients}} near this block."},
SetPitch={Params="Pitch",Return="",Notes="Sets a new pitch for the block."},
},
Inherits="cBlockEntity",
},-- cNoteEntity
cSignEntity=
{
Desc=[[
A sign entity represents a sign in the world. This class is only used when generating chunks, so
that the plugins may generate signs within new chunks. See the code example in {{cChunkDesc}}.
]],
Functions=
{
GetLine={Params="LineIndex",Return="string",Notes="Returns the specified line. LineIndex is expected between 0 and 3. Returns empty string and logs to server console when LineIndex is invalid."},
SetLine={Params="LineIndex, LineText",Return="",Notes="Sets the specified line. LineIndex is expected between 0 and 3. Logs to server console when LineIndex is invalid."},
SetLines={Params="Line1, Line2, Line3, Line4",Return="",Notes="Sets all the sign's lines at once."},