Skip to content

Commit

Permalink
merge plugin api a5 doc
Browse files Browse the repository at this point in the history
not out yet but will be soon 😉
  • Loading branch information
OtterCodes101 authored Sep 26, 2023
2 parents 29f17fc + 63cb5eb commit 2e64d52
Show file tree
Hide file tree
Showing 7 changed files with 506 additions and 9 deletions.
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

0 comments on commit 2e64d52

Please sign in to comment.