Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PluginAPI a5 doc. #10

Merged
merged 6 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/plugindocs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ The Plugin API consists of a global JavaScript object on the window, called, ver


It has the following properties:
- `player: PlayerData`
- `player: LocalPlayerData`
- A [`LocalPlayerData`](globals/LocalPlayerData.md) made from `EntityPlayerSP`.
- `items: ItemData{}`
- A [`ItemData`](globals/ItemData.md) dictionary of all item types, and block-item types. [Auto]
Expand Down
474 changes: 474 additions & 0 deletions src/plugindocs/events/FromServerEvents.md

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions src/plugindocs/events/addEventListener.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,24 @@ It has the following valid values:

- `sendchatmessage`
Called just before the player sends a chat message. Passes an object with properties:
- `message` String representing the chat message.
- `preventDefault` Boolean representing whether or not to cancel sending the packet. Default is `false`.
- `message`: String representing the chat message.
- `preventDefault:` Boolean representing whether or not to cancel sending the packet. Default is `false`.

- `postmotionupdate`
Called after player motion is updated. No arguments passed to callback.

- `premotionupdate`
Called before player motion is updated. Passes an object with properties:
- `yaw` Number representing the player's yaw rotation.
- `pitch` Number representing the player's pitch rotation.
- `onGround` Boolean representing whether the player is on ground or not.
- `yaw`: Number representing the player's yaw rotation.
- `pitch`: Number representing the player's pitch rotation.
- `onGround`: Boolean representing whether the player is on ground or not.

- `key`
Called when a special keypress is detected. ie: not `esc` or `open chat`, like `f3` or the letter `J`.
Passes an object with properties:
- `key` Integer representing the LWJGL key code.
- `preventDefault` Boolean representing whether or not to prevent the default action for this key (if any).
- `key`: Integer representing the LWJGL key code.
- `preventDefault`: Boolean representing whether or not to prevent the default action for this key (if any).


More events:
[Receiving packet events](FromServerEvents.md)
2 changes: 2 additions & 0 deletions src/plugindocs/globals/BlockData.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Has the following properties:
- `lightValue`: Integer: equal to the block's `lightValue`
- `blockHardness`: Integer: equal to the block's `blockHardness`
- `blockResistance`: Integer: equal to the block's `blockResistance`
- `noRender`: Boolean: equal to the block's `noRender`
- `forceRender`: Boolean: equal to the block's `forceRender`

It has the following methods:
- `getID() : Integer`
6 changes: 6 additions & 0 deletions src/plugindocs/globals/ChunkData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# ChunkData
Represents chunk data from a packet.

Has the following properties:
- `data : Byte[]`
- `dataSize : Integer`
2 changes: 1 addition & 1 deletion src/plugindocs/globals/ListOfGlobals.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# List of Globals

- `PluginAPI.player`
A [`PlayerData`](PlayerData.md) made from `EntityPlayerSP`.
A [`LocalPlayerData`](LocalPlayerData.md) made from `EntityPlayerSP`.
- `PluginAPI.items`
An [`ItemData`](ItemData.md) array of all the in-game item types, and block-item types. [Auto]
- `PluginAPI.blocks`
Expand Down
11 changes: 11 additions & 0 deletions src/plugindocs/globals/Vec4b.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Vec4b
Represents a 4 dimensional byte.

### Constructor:
PluginAPI.contructors.Vec4b({a: Byte, b: Byte, c: Byte, d: Byte})

Has the following properties:
- `a` : Byte
- `b` : Byte
- `c` : Byte
- `d` : Byte