FANDOM


Most functions on this page work with both custom stuff 2 and 1

Player functions can modify inventory, position, hp, hungry etc.

Events with player functions can be called

  • eaten (items)
  • hitmob (items)
  • rightclick (items)
  • rightclickair (items)
  • blockdestroyed (items)
  • inuse (items)
  • clicked (blocks)
  • rightclicked (blocks)

Functions

Function Description Arguments
move Moves player Position pos
setPosition Sets player position Position pos
dropItem Spawns an item next to the player. int id, int count, int damage
setHealth Sets player health to x int health
addVelo Pokes player from behind with x velocity double x, double y, double z
getPositionX Gets player's X position
getPositionY Gets player's Y position
getPositionZ Gets player's Z position
getLookX Gets the X coord of the block the player is looking int maxdistance
getLookY Gets the Y coord of the block the player is looking int maxdistance
getLookZ Gets the Z coord of the block the player is looking int maxdistance
getHealth Gets player's health
getHunger Gets player's hunger
getSaturation Gets player's saturation
setHunger Sets player's hunger int amount
addHunger Adds player's hunger int amount
setSaturation Sets player's saturation float amount
addSaturation Adds player's saturation float amount
getLookingSide "Hey, what are you looking at?"
sendMessage Sends player a message string message
clearInventory Clears player's inventory
fillInventory Fills player's inventory int id, int damage
addToInventory Adds x to player's inventory int id, int count, int damage
removeFromInventory Removes x from player's inventory int id, int count, int damage
clearInventorySlot Clears inventroy slot int slotId
fillInventorySlot Fills inventory slot int slotId
setInventorySlot Sets inventory slot to x int slotId, int id, int count, int damage
removeFromInventorySlot Removes x from the inventory slot int slotId, int count
addToInventorySlot Adds x to theinventory slot int slotId, int count
damageItem "hey,dont break my %item_name%!!!" int slotId, int damage
placeBlock Places block Position pos, int id, int damage, int side
getCurrentSlot Gets current slotid
getItemId Gets item id int slotId
getItemStackSize Gets item stack size int slotId
getItemDamage Gets item damage int slotId
getMaxItemDamage Gets max item damage int slotId
getItemCount Gets item count int id, int damage
remove An alternative to removeFromInventory int id, int count, int damage
getType[1]
setItemInUse Sets the current item in use (so the inuse trigger is called)

References

  1. New Function introduced in Custom Stuff 2.3.0. More information is required

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.