public class ScriptableEntityPlayer extends ScriptableEntityLiving
| Constructor and Description |
|---|
ScriptableEntityPlayer(net.minecraft.src.EntityPlayer player) |
| Modifier and Type | Method and Description |
|---|---|
int |
add(int id,
int count,
int metadata)
Adds items to the player's iventory if there's space for them.
|
void |
addEnchantment(int slotId,
int id,
int level)
Adds an enchantment to the itemstack in the given slot
|
int |
addToSlot(int slotId,
int count)
Adds items to an inventory slot if it isn't empty
|
void |
clearEnchantments(int slotId)
Removes all enchantments from the itemstack in the given slot
|
void |
clearInventory()
Clears the player's inventory
|
void |
clearSlot(int slotId)
Clears an inventory slot
|
void |
damageItem(int slotId,
int count)
Damages an item in the player's inventory
|
int |
fillInventory(int id,
int metadata)
Fills the player's inventory.
|
int |
fillSlot(int slotId)
Fills an inventory slot if it isn't empty
|
int |
getCurrentSlot()
Gets the id of the slot the player is currently using
|
int |
getHunger()
Gets the player's hunger
|
int |
getItemCount(int id,
int metadata)
Gets the count of a item in the player's inventory
|
int |
getItemId(int slotId)
Gets the item's id in the player's inventory
|
int |
getItemMetadata(int slotId)
Gets the item's metadata in the player's inventory
|
int |
getItemStackSize(int slotId)
Gets the item's stack size in the player's inventory
|
ScriptablePosition |
getLookPos()
Gets the position of the block, that the player is looking on
|
double |
getSaturation()
Gets the player's saturation
|
double |
getStepHeight()
Gets the step height
|
boolean |
hasEnchantment(int slotId)
Checks if the itemstack in the given slot has any enchantment
|
boolean |
hasEnchantment(int slotId,
int id)
Checks if the itemstack has the given enchantment enchantment
|
boolean |
hasEnchantment(int slotId,
int id,
int level)
Checks if the itemstack has the given enchantment enchantment
|
void |
openGui(java.lang.String guiName,
int x,
int y,
int z)
Opens a gui for the player.
|
void |
openGui(java.lang.String guiName,
ScriptablePosition position)
Opens a gui for the player.
|
boolean |
placeBlock(int x,
int y,
int z,
int side,
int id,
int metadata,
boolean flag)
Places a block
|
boolean |
placeBlock(ScriptablePosition position,
int side,
int id,
int metadata,
boolean flag)
Places a block
|
int |
remove(int id,
int count,
int metadata)
Removes items from the player's inventory
|
void |
removeEnchantment(int slotId,
int id)
Removes an enchantment from the itemstack in the given slot
|
int |
removeFromSlot(int slotId,
int count)
Removes items from an inventory slot
|
void |
repairItem(int slotId)
Fully repairs an item in the player's inventory
|
void |
repairItem(int slotId,
int count)
Repairs an item in the player's inventory
|
void |
sendMessage(java.lang.String message)
Adds a message to the player
|
void |
setHunger(int hunger)
Sets the player's hunger
|
void |
setItemInUse()
Sets the current item in use, so onusing is called.
|
void |
setSaturation(double saturation)
Sets the player's saturation
|
int |
setSlot(int slotId,
int id,
int count,
int metadata)
Sets an inventory slot
|
void |
setStepHeight(double f)
Sets how high this entity can step up when running into a block to try to
get over it
|
addPotionEffect, attack, colorSheep, getHealth, getLookingSide, getMaxHealth, growSheepWool, setHealthaddVelocity, addVelocityToLookingDirection, dropItem, extinguish, getName, getPosX, getPosY, getPosZ, move, move, sePosition, setAir, setFire, setPosition, setPosX, setPosY, setPosZ, setVelocity, setVelocityToLookingDirection, shearpublic ScriptableEntityPlayer(net.minecraft.src.EntityPlayer player)
public void openGui(java.lang.String guiName,
ScriptablePosition position)
guiName - The name of the gui used for the name-attribute in the
gui-fileposition - The position of the block to open a gui for.public void openGui(java.lang.String guiName,
int x,
int y,
int z)
guiName - The name of the gui used for the name-attribute in the
gui-filex - The x-coordinate of the blocky - The y-coordinate of the blockz - The z-coordinate of the blockpublic void setHunger(int hunger)
hunger - The hunger to setpublic int getHunger()
public void setSaturation(double saturation)
saturation - The saturation to setpublic double getSaturation()
public void setStepHeight(double f)
f - The step heightpublic double getStepHeight()
public void sendMessage(java.lang.String message)
message - The message to sendpublic void setItemInUse()
public void clearInventory()
public int fillInventory(int id,
int metadata)
id - The item's idmetadata - The item's damage valuepublic int add(int id,
int count,
int metadata)
id - The item's idcount - The item's stack sizemetadata - The item's damage valuepublic int remove(int id,
int count,
int metadata)
id - The item's idcount - The item's stack sizemetadata - The item's damage valuepublic void clearSlot(int slotId)
slotId - The slot's idpublic int fillSlot(int slotId)
slotId - The slot's idpublic int setSlot(int slotId,
int id,
int count,
int metadata)
slotId - The slot's idid - The item's idcount - The item's stack sizemetadata - The item's damage valuepublic int addToSlot(int slotId,
int count)
slotId - The slot's idcount - The count to addpublic int removeFromSlot(int slotId,
int count)
slotId - The slot's idcount - The count of items to removepublic void damageItem(int slotId,
int count)
slotId - The slot's idcount - The damage to add to the itempublic void repairItem(int slotId)
slotId - The slot's idpublic void repairItem(int slotId,
int count)
slotId - The slot's idcount - The damage to remove from the itempublic int getItemId(int slotId)
slotId - The slot's idpublic int getItemStackSize(int slotId)
slotId - The slot's idpublic int getItemMetadata(int slotId)
slotId - The slot's idpublic boolean hasEnchantment(int slotId)
slotId - The slot's idpublic boolean hasEnchantment(int slotId,
int id)
slotId - The slot's idid - The id of the enchantmentpublic boolean hasEnchantment(int slotId,
int id,
int level)
slotId - The slot's idid - The id of the enchantmentlevel - The level of the enchantmentpublic void clearEnchantments(int slotId)
slotId - The slot's idpublic void addEnchantment(int slotId,
int id,
int level)
slotId - The slot's idid - The id of the enchantmentlevel - The level of the enchantmentpublic void removeEnchantment(int slotId,
int id)
slotId - The slot's idid - The id of the enchantmentpublic int getItemCount(int id,
int metadata)
id - The item's idmetadata - The item's damage valuepublic int getCurrentSlot()
public boolean placeBlock(ScriptablePosition position, int side, int id, int metadata, boolean flag)
position - The positionside - On what side at position the block should be addedid - The block's idmetadata - The block's metadataflag - If true the function will uses blocks from the inventory and
won't place any block if the required block isn't in the player's
inventorypublic boolean placeBlock(int x,
int y,
int z,
int side,
int id,
int metadata,
boolean flag)
x - The x coordinatey - The y coordinatez - The z coordinateside - On what side at position the block should be addedid - The block's idmetadata - The block's metadataflag - If true the function will uses blocks from the inventory and
won't place any block if the required block isn't in the player's
inventorypublic ScriptablePosition getLookPos()