If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at
the top of the file.
Allows scripts to send data from the server to the client. This system provides a way for server side scripts to send data to client side only scripts, and trigger events from the server. An example of this would be (neoforge only): <code> // Listens to the ItemTossEvent events.register<ItemTossEvent>(event => { if event.player is ServerPlayer { // If the player is a ServerPlayer, send data to the client using the "toss" id network.sendTo(event.player as ServerPlayer, "toss", {custom: "data"}); } }); // Using the 'onlyif side client' preprocessor, we can ensure script lines are only ran on the Client distribution. #onlyif side client // Listen for data sent to the "toss" id network.onData("toss", (data, context) => { // Prints the data that was received println(data.getAsString()); }); #endif </code>