Skip to content

Classes and objects

A class defines a kind of object: the fields it stores and the methods it supports. An object is one instance of that class. A PlayerStats class might store points and provide an AddPoints method.

  1. Enter your plot with Dev access and run /plot classes.
  2. Create a class and give it a descriptive name.
  3. Open its editor to add fields, choose its mode, and configure Class Structure.
  4. Assign Method definitions to the class through their definition settings.
  5. Compile after changing declarations.

Classes have stable identities across renames. Choose declarations from the menus rather than attempting to connect them only through matching text.

Every plot starts with Main, a static class by default. Static classes group shared fields and methods; they are not objects you instantiate. They stay out of Objects and object-instance type choices, contain only static members, and are always final.

An instance class can create separate objects. Two PlayerStats objects can contain different scores. To call an instance method, provide an object of that class (or a compatible subclass) as the receiver.

Change Class: Static / Class: Instance in the class editor. To convert an instance class to Static, first remove constructors and make its members static. Main may explicitly be changed to Instance. New fields in a static class are static automatically.

Use a static utility class for reusable player actions or shared calculations. Use an instance class for per-player/session records or behavior that belongs to a particular object. Public/Save Variable scopes govern stored bindings; class static/instance status governs member ownership. They solve different problems.

Copy an inventory item onto Set Display Item in the class editor. Its appearance is reused in class choices, Variables, method entries, headers, and input placeholders.

Open Codeblock Settings to copy a Call Method Block and an If Block, plus choose their shared Codeblock Color. The palette includes the 16 wool colors, Moss, and Pale Moss. These settings affect editor appearance, not dispatch or typing. Right-click resets configurable materials to defaults.

Continue with fields, constructors, and inheritance.