Editing Mod Server API
From Eco - English Wiki
Your changes will be displayed to readers once an authorized user accepts them. (help)
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
== Introduction == | == Introduction == | ||
This page provides some tips for how to interact with the Server API when you create mod that needs to interact with the game's runtime state or behaviour. A full comprehensive list of the entire API can be found at https://docs.play.eco/api/server/index.html. | This page provides some tips for how to interact with the Server API when you create mod that needs to interact with the game's runtime state or behaviour. A full comprehensive list of the entire API can be found at https://docs.play.eco/api/server/index.html. | ||
== Player == | == Player == | ||
The <code>User</code> and <code>Player</code> class contain references to information about a specific player. The <code>User</code> class contains references to the player's owned objects, inventories, their stats, professions, etc. While the <code>Player</code> class has references to their location, technical server properties, player name, etc. If you have a <code>User</code> and need to get a <code>Player</code> instance it's as simple as: | The <code>User</code> and <code>Player</code> class contain references to information about a specific player. The <code>User</code> class contains references to the player's owned objects, inventories, their stats, professions, etc. While the <code>Player</code> class has references to their location, technical server properties, player name, etc. If you have a <code>User</code> and need to get a <code>Player</code> instance it's as simple as: | ||
Line 17: | Line 15: | ||
user.Inventory.Clothing | user.Inventory.Clothing | ||
user.Inventory.Toolbar | user.Inventory.Toolbar | ||
The items in these inventories can be accessed in a couple different ways as discussed in the | The items in these inventories can be accessed in a couple different ways as discussed in the Inventory Section. Each of these is an instance of [https://docs.play.eco/api/server/eco.gameplay/Eco.Gameplay.Items.Inventory.html Inventory]. | ||
[[File:ActionBarScreenshot.png|thumb|user.Inventory.ActionBar]] | |||
<code>user.Inventory.ActionBar</code> represents all the standard buttons used to open the backpack, economy viewer, etc. located next to the minimap. | <code>user.Inventory.ActionBar</code> represents all the standard buttons used to open the backpack, economy viewer, etc. located next to the minimap. | ||
Line 24: | Line 22: | ||
<code>user.Inventory.Carried</code> represents the stack of items the player can carry around such as dirt, stone, or logs. | <code>user.Inventory.Carried</code> represents the stack of items the player can carry around such as dirt, stone, or logs. | ||
<code>user.Inventory.Clothing</code> represents the items of clothing the player is wearing. | <code>user.Inventory.Clothing</code> represents the items of clothing the player is wearing. | ||
[[File:ToolbarScreenshot.png|thumb|user.Inventory.Toolbar]] | |||
<code>user.Inventory.Toolbar</code> represents the items on the player's toolbar where they put tools and other items they want quick access to. | <code>user.Inventory.Toolbar</code> represents the items on the player's toolbar where they put tools and other items they want quick access to. | ||