This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Called before the console command is parsed. Return true if you don't
* want the server command to be parsed by the server.
* Called before the console command is parsed. Return true if you don't want the server command to be parsed by the server.
*
* @param split
* @return false if you want the command to be parsed.
@@ -178,18 +171,15 @@ public void onKick(Player mod, Player player, String reason) {
}
/**
* Called when someone presses right click aimed at a block. You can
* intercept this to add your own right click actions to different item
* types (see itemInHand)
* Called when someone presses right click aimed at a block. You can intercept this to add your own right click actions to different item types (see itemInHand)
*
* @param player
* @param blockPlaced
* @param blockClicked
* @param itemInHand
* @return false if you want the action to go through
*
* @deprecated use {@link #onBlockRightClick(Player, Block, Item)} to get
* the information
* @deprecated use {@link #onBlockRightClick(Player, Block, Item)} to get the information
* Called when either a lava block or a lighter tryes to light something on
* fire. block status depends on the light source: 1 = lava. 2 = lighter
* (flint + steel). 3 = spread (dynamic spreading of fire). 4 = fire
* destroying a block. 5 = lightning
* Called when either a lava block or a lighter tryes to light something on fire. block status depends on the light source: 1 = lava. 2 = lighter (flint + steel). 3 = spread (dynamic spreading of fire). 4 = fire destroying a block. 5 = lightning
*
* @param block
* block that the fire wants to spawn in.
@@ -309,16 +290,12 @@ public boolean onIgnite(Block block, Player player) {
}
/**
* Called when a dynamite block or a creeper is triggerd. block status
* @deprecated Use onExplode(Block,OEntity,HashSet) instead. You can still
* use block.getStatus to get what exploded, as well as using
* OEntity.
* @deprecated Use onExplode(Block,OEntity,HashSet) instead. You can still use block.getStatus to get what exploded, as well as using OEntity.
* @return true if you dont the block to explode.
*/
@Deprecated
@@ -327,18 +304,15 @@ public boolean onExplode(Block block) {
}
/**
* Called when a tnt block, creeper, or ghast fireball explodes. Block
* status depends on the entity exploding: 1 = tnt. 2 = creeper. 3 = ghast
* fireball.
* Called when a tnt block, creeper, or ghast fireball explodes. Block status depends on the entity exploding: 1 = tnt. 2 = creeper. 3 = ghast fireball.
*
* You can also get the explosion type from OEntity using instanceof.
*
* @param block
* The block location where the explosion occurred.
*
* @param entity
* The entity that caused the explosion(tnt, creeper, or
* fireball)
* The entity that caused the explosion(tnt, creeper, or fireball)
*
* @param blocksaffected
* The blocks affected by the explosion in a hashset.
* Called when fluid wants to flow to a certain block. (10 & 11 for lava and
* 8 & 9 for water)
* Called when fluid wants to flow to a certain block. (10 & 11 for lava and 8 & 9 for water)
*
* @param blockFrom
* the block where the fluid came from. (blocktype = fluid type)
@@ -375,8 +348,7 @@ public boolean onMobSpawn(Mob mob) {
}
/**
* Called when a living object is attacked. tip: Use isMob() and isPlayer()
* and getPlayer().
* Called when a living object is attacked. tip: Use isMob() and isPlayer() and getPlayer().
*
* @param type
* type of damage dealt.
@@ -409,15 +381,11 @@ public boolean onHealthChange(Player player, int oldValue, int newValue) {
}
/**
* Called whenever a redstone source (wire, switch, torch) changes its
* current.
* Called whenever a redstone source (wire, switch, torch) changes its current.
*
* Standard values for wires are 0 for no current, and 14 for a strong
* current. Default behaviour for redstone wire is to lower the current by
* one every block.
* Standard values for wires are 0 for no current, and 14 for a strong current. Default behaviour for redstone wire is to lower the current by one every block.
*
* For other blocks which provide a source of redstone current, the current
* value will be 1 or 0 for on and off respectively.
* For other blocks which provide a source of redstone current, the current value will be 1 or 0 for on and off respectively.
* Called when the game is checking the physics for a certain block. This
* method is called frequently whenever a nearby block is changed, or if the
* block has just been placed. Currently the only supported blocks are sand,
* gravel and portals.
* Called when the game is checking the physics for a certain block. This method is called frequently whenever a nearby block is changed, or if the block has just been placed. Currently the only supported blocks are sand, gravel and portals.
* Called when someone presses right click aimed at a block. You can
* intercept this to add your own right click actions to different item
* types (see itemInHand)
* Called when someone presses right click aimed at a block. You can intercept this to add your own right click actions to different item types (see itemInHand)
*
* @deprecated Use {@link #onBlockRightClick(Player, Block, Item) } instead.
* Called when someone presses right click aimed at a block. You can
* intercept this to add your own right click actions to different item
* types (see itemInHand)
* Called when someone presses right click aimed at a block. You can intercept this to add your own right click actions to different item types (see itemInHand)
* Called when water or lava tries to populate a block, you can prevent
* crushing of torches, railways, flowers etc. You can alternatively allow
* to let normally solid blocks be crushed.
* Called when water or lava tries to populate a block, you can prevent crushing of torches, railways, flowers etc. You can alternatively allow to let normally solid blocks be crushed.
*
* @param currentState
* the current tristate, once it's set to a non DEFAULT_ACTION it
* is final.
* the current tristate, once it's set to a non DEFAULT_ACTION it is final.
* @param liquidBlockId
* the type of the attacking block
* @param targetBlock
@@ -628,10 +585,7 @@ public PluginLoader.HookResult onLiquidDestroy(PluginLoader.HookResult currentSt
}
/**
* Called when an entity (attacker) tries to hurt a player (defender).
* Returning 'true' prevents all damage, returning 'false' lets the game
* handle it. Remember that the damage will be lessened by the amount of
* {@link LivingEntity#getLastDamage()} the defender has.
* Called when an entity (attacker) tries to hurt a player (defender). Returning 'true' prevents all damage, returning 'false' lets the game handle it. Remember that the damage will be lessened by the amount of {@link LivingEntity#getLastDamage()} the defender has.
*
* @param attacker
* the giver
@@ -646,8 +600,7 @@ public boolean onAttack(LivingEntity attacker, LivingEntity defender, Integer am
}
/**
* Called when a player attempts to open an inventory; whether it's a
* workbench, a chest or their own player inventory
* Called when a player attempts to open an inventory; whether it's a workbench, a chest or their own player inventory
@@ -838,10 +786,7 @@ public void onChunkLoaded(Chunk chunk) {
}
/**
* Called when a chunk is generated. Tips: Return a byte[32768] if you want
* to generate a new chunk. The index of the block is: (x * 16 + z) * 128 +
* y where 0<=x<16, 0<=z<16 and 0<=y<128 Use world.getRandomSeed() or (x *
* 0x4f9939f508L + z * 0x1ef1565bd5L) as seed for your Random.
* Called when a chunk is generated. Tips: Return a byte[32768] if you want to generate a new chunk. The index of the block is: (x * 16 + z) * 128 + y where 0<=x<16, 0<=z<16 and 0<=y<128 Use world.getRandomSeed() or (x * 0x4f9939f508L + z * 0x1ef1565bd5L) as seed for your Random.
*
* @param x
* @param z
@@ -853,12 +798,10 @@ public byte[] onChunkCreate(int x, int z, World world) {
}
/**
* Called when a spawnpoint is generated. If you don't implement this when
* overriding onChunkCreate, this could cause an OutOfMemoryError.
* Called when a spawnpoint is generated. If you don't implement this when overriding onChunkCreate, this could cause an OutOfMemoryError.
*
* @param world
* @return The location of the spawnpoint. The values are rounded to
* integers, elevation and pitch are ignored.
* @return The location of the spawnpoint. The values are rounded to integers, elevation and pitch are ignored.
* @deprecated Use {@link #onEntityRightClick(Player, Entity, Item) }
* instead.
* @deprecated Use {@link #onEntityRightClick(Player, Entity, Item) } instead.
* @return true if to prevent the player from milking the cow
*/
@Deprecated
@@ -1088,20 +1030,12 @@ public Object onPlayerDisconnect(Player player, HookParametersDisconnect hookPar
}
/**
* Called when someone presses right click aimed at an entity. You can
* intercept this to add your own right click actions to different item
* types (see itemInHand) Some interactions update the player's item in hand
* (for example shearing a sheep), but some do not (like using an item on a
* player). If you want to update the item stack anyways, you should return
* ALLOW_ACTION.
* Called when someone presses right click aimed at an entity. You can intercept this to add your own right click actions to different item types (see itemInHand) Some interactions update the player's item in hand (for example shearing a sheep), but some do not (like using an item on a player). If you want to update the item stack anyways, you should return ALLOW_ACTION.
*
* @param player
* @param entityClicked
* @param itemInHand
* @return ALLOW_ACTION to allow interaction and always update the item
* stack the player is holding, DEFAULT_ACTION to allow interaction
* and update the item stack if needed by default. PREVENT_ACTION to
* prevent the interaction when right clicking completely.
* @return ALLOW_ACTION to allow interaction and always update the item stack the player is holding, DEFAULT_ACTION to allow interaction and update the item stack if needed by default. PREVENT_ACTION to prevent the interaction when right clicking completely.