Skip to content

Player Functions

wagyourtail edited this page Sep 20, 2020 · 9 revisions

The player functions are:

openInventory()

Example: player.openInventory()

returns an instance of the Inventory class

getPlayer() 1.0.3+

Example: player.getPlayer()

returns an instance of the ClientPlayerEntityHelper class

getGameMode() 1.0.9+

Example: player.getGameMode()

returns the player's game mode as a string.

rayTraceBlock(Int, Bool) 1.0.5+

Example: player.rayTraceBlock(distance, see_fluid)

returns an instance of the BlockDataHelper class

rayTraceEntity() 1.0.5+

Example: player.rayTraceEntity()

returns an instance of the EntityHelper class

writeSign(String, String, String, String) 1.2.2+

Example: world.writeSign(line1, line2, line3, line4)

returns a boolean of whether sign screen was open.

takeScreenshot(String[, String], Consumer) 1.2.6+

Example: player.takeScreenshot(folder, file, (chatmsg) => {chat.log(chatmsg)})

folder is relative to the base macro directory, it will put the screenshot inside a folder created there called screenshots. ie. if you have a folder name of ./test, it will put the screenshot in ./test/screenshots.

Takes a screenshot and callback's a TextHelper representing the chat message.

Clone this wiki locally