hytopia
Version:
The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.
55 lines (26 loc) • 769 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [client](./client.md) > [HytopiaUI](./client.hytopiaui.md) > [onData](./client.hytopiaui.ondata.md)
## HytopiaUI.onData() method
Registers a listener for data received by the server from `player.ui.sendData()`<!-- -->.
**Signature:**
```typescript
onData(callback: (data: object) => void): void;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
callback
</td><td>
(data: object) => void
</td><td>
Function to call when data is received from the server.
</td></tr>
</tbody></table>
**Returns:**
void