Single module modding
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Players
|
||||
|
||||
Server scripts see players as `Player` objects: in events, in component handlers, from `ctx.players`, and as the source
|
||||
of a command.
|
||||
The server phase sees players as `Player` objects: in events, in component handlers, from `ctx.players`, and as the
|
||||
source of a command.
|
||||
|
||||
## Finding Players
|
||||
|
||||
@@ -181,7 +181,7 @@ their eyes at 0.6, so they fit through 1-block gaps. Under a low ceiling they st
|
||||
stand up.
|
||||
|
||||
`player.is_swimming()` says whether a player is swimming, like NeoForge's `isSwimming()`. It works on the server and in
|
||||
client scripts, where `ctx.player.is_swimming()` is about the player on this client:
|
||||
the client phase, where `ctx.player.is_swimming()` is about the player on this client:
|
||||
|
||||
```ts
|
||||
if (player.is_swimming()) player.add_effect("bworld:speed", 20);
|
||||
@@ -190,7 +190,7 @@ if (player.is_swimming()) player.add_effect("bworld:speed", 20);
|
||||
## Sneaking
|
||||
|
||||
`player.is_sneaking()` says whether a player holds the sneak key, like NeoForge's `isShiftKeyDown()`. It's the key, not
|
||||
the pose: a player flying down holds it too. Their client tells the server as soon as it changes. In client scripts,
|
||||
the pose: a player flying down holds it too. Their client tells the server as soon as it changes. In the client phase,
|
||||
`ctx.player.is_sneaking()` is about the player on this client.
|
||||
|
||||
Sneaking changes what right clicking a block does, like Minecraft: with an item in hand, the block isn't used at all,
|
||||
|
||||
Reference in New Issue
Block a user