public class ScriptableEntityPlayer extends ScriptableEntityLiving
Constructor and Description |
---|
ScriptableEntityPlayer(net.minecraft.entity.player.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
|
void |
addExperience(int amount)
Adds experience to the player
|
void |
addExperienceLevel(int amount)
Adds level to the player
|
int |
addToSlot(int slotId,
int count)
Adds items to an inventory slot if it isn't empty
|
boolean |
canEfficientlyBreak(int slotId,
int blockId,
int metadata)
Checks if the itemstack int the given slot can efficiently break the given block.
|
boolean |
canHarvest(int slotId,
int blockId,
int metadata)
Checks if the itemstack in the given slot can harvest the given block.
|
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 |
getExperience()
Gets the player's experience
|
int |
getExperienceLevel()
Gets the player's level
|
float |
getHorizontalAngle()
Gets the player's horizontal look angle
|
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 |
getItemMaxStackSize(int slotId)
Gets the maximum stack size of an item 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
|
int |
getLookX()
Gets the x-coordinate of the block that the player is looking on.
|
int |
getLookY()
Gets the y-coordinate of the block that the player is looking on.
|
int |
getLookZ()
Gets the z-coordinate of the block that the player is looking on.
|
int |
getMaxHealth()
Gets the player's max health
|
double |
getSaturation()
Gets the player's saturation
|
float |
getStackFloatData(int slotId,
java.lang.String name)
Gets a stack's float data.
|
int |
getStackIntData(int slotId,
java.lang.String name)
Gets a stack's int data.
|
java.lang.String |
getStackStringData(int slotId,
java.lang.String name)
Gets a stack's string data
|
double |
getStepHeight()
Gets the step height
|
java.lang.String |
getUsername()
Gets the player's username
|
float |
getVerticalAngle()
Gets the player's vertical look angle
|
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
|
boolean |
isSneaking()
Check if the player is sneaking
|
boolean |
isSprinting()
Checks if the player is sprinting
|
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
|
void |
removeExperience(int amount)
Removes experience from the player
|
void |
removeExperienceLevel(int amount)
Removes level from the player
|
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 |
sendChat(java.lang.String chat)
Makes the player send a chat message as if the message was sent with the chat console.
|
void |
sendMessage(java.lang.String message)
Displays a message for the player.
|
void |
setExperience(int amount)
Sets the player's experience
|
void |
setExperienceLevel(int level)
Sets the player's level
|
void |
setHunger(int hunger)
Sets the player's hunger
|
void |
setItemInUse()
Sets the current item in use, so onusing is called.
|
void |
setMaxHealth(int value)
Sets the player's max health
|
void |
setSaturation(double saturation)
Sets the player's saturation
|
int |
setSlot(int slotId,
int id,
int count,
int metadata)
Sets an inventory slot
|
void |
setStackFloatData(int slotId,
java.lang.String name,
float data)
Sets the stack's float data
|
void |
setStackIntData(int slotId,
java.lang.String name,
int data)
Sets the stack's int data
|
void |
setStackStringData(int slotId,
java.lang.String name,
java.lang.String data)
Sets the stack's string data
|
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, growSheepWool, setHealth
addVelocity, addVelocityToLookingDirection, dropItem, extinguish, getFallDistance, getName, getPosX, getPosY, getPosZ, getVelocityX, getVelocityY, getVelocityZ, isItem, isLiving, isPlayer, move, move, setAir, setFallDistance, setFire, setMod, setPosition, setPosition, setPosX, setPosY, setPosZ, setVelocity, setVelocityToLookingDirection, setVelocityX, setVelocityY, setVelocityZ, shear
public ScriptableEntityPlayer(net.minecraft.entity.player.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 displaypublic void sendChat(java.lang.String chat)
chat
- The chat messagepublic 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 getItemMaxStackSize(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 int getLookX()
public int getLookY()
public int getLookZ()
public void addExperience(int amount)
amount
- The amount of xppublic void removeExperience(int amount)
amount
- The amount of xp to removepublic void setExperience(int amount)
amount
- The new xp of the playerpublic void addExperienceLevel(int amount)
amount
- The amount of levelspublic void removeExperienceLevel(int amount)
amount
- The amount of levelspublic void setExperienceLevel(int level)
level
- The levelpublic int getExperience()
public int getExperienceLevel()
public float getHorizontalAngle()
public float getVerticalAngle()
public java.lang.String getUsername()
public boolean isSneaking()
public boolean isSprinting()
public int getStackIntData(int slotId, java.lang.String name)
slotId
- The slot's idname
- The name of the datapublic float getStackFloatData(int slotId, java.lang.String name)
slotId
- The slot's idname
- The name of the datapublic java.lang.String getStackStringData(int slotId, java.lang.String name)
slotId
- The slot's idname
- The name of the datapublic void setStackIntData(int slotId, java.lang.String name, int data)
slotId
- The slot's idname
- The name of the datadata
- The datapublic void setStackFloatData(int slotId, java.lang.String name, float data)
slotId
- The slot's idname
- The name of the datadata
- The datapublic void setStackStringData(int slotId, java.lang.String name, java.lang.String data)
slotId
- The slot's idname
- The name of the datadata
- The datapublic void setMaxHealth(int value)
value
- The new max healthpublic int getMaxHealth()
getMaxHealth
in class ScriptableEntityLiving
public boolean canEfficientlyBreak(int slotId, int blockId, int metadata)
slotId
- The slot's idblockId
- The block's idmetadata
- The block's metadatapublic boolean canHarvest(int slotId, int blockId, int metadata)
slotId
- The slot's idblockId
- The block's idmetadata
- The block's metadata