This commit is contained in:
ZXMushroom63 2025-04-11 20:43:40 +08:00
commit a85b9c2524
3 changed files with 3 additions and 2 deletions

View File

@ -62,7 +62,7 @@ When TeaVM translates booleans, it converts booleans to integers:
- `false` turns into `0`
- `true` turns into `1`
So when we override `hasParticlesInAlphaLayer`, we'll need to return a `0` or a `1`. Since we want the game to thing that there aren't any particles in the alpha layer, we'll return `0` (false).
So when we override `hasParticlesInAlphaLayer`, we'll need to return a `0` or a `1`. Since we want the game to think that there aren't any particles in the alpha layer, we'll return `0` (false).
```javascript
(function NoParticles() {

View File

@ -1,6 +1,6 @@
## /hat with ModAPI
/hat is a common server-side plugin that lets you put any block/item on your head. This tutorial will explain how to register a server-side command, construct a packet, and send it to a player.
[`S09PacketHeldItemChange` constructors]()
[`S09PacketHeldItemChange` constructors](https://nurmarvin.github.io/Minecraft-1.8-JavaDocs/net/minecraft/network/play/server/S09PacketHeldItemChange.html)
As always, start with the basic boilerplate IIFE with credits:

View File

@ -15,6 +15,7 @@ We'll begin with the basic boilerplate mod code:
Let's write the client side part of the code first.
- We'll get the keys for the ModAPI.blocks object (ids of each block) using [`Object.keys()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys)
- Then, we'll loop over those keys, and modify their respective block to be as slippery as ice.
```javascript
var blockKeys = Object.keys(ModAPI.blocks);