Documentation Powered by Slate Introduction ct. Scripts are able to be hot reloaded, which means you can make changes to your mod caht restarting! For the almost full feature list,check our compatibility table ; Some of this documentation may be out of date or incomplete. Setup To setup ct. By default, ct. To access the ct.
The rest of this tutorial will refer to this chta as the "modules directory", and will assume it is in the default location. Creating a module To create a module, create a folder lesbians sex chats your modules folder. The folder can have whatever name you want, but typically it is just the name of the module. Our module will be called ExampleModule. Our folder structure now chwt like. The metadata file An example metadata.
This file contains important information about our module. You can see an example of this file to the right.
The metadata file contains a of important fields, documented here: name: The name of the module creator: The name of the module creator version: The version of the module. This key is necessary if, for example, your module registers triggers or commands. If all your module provides is a library that other modules can use, this is not needed.
These modules are guaranteed to be loaded before your module, allowing you to use them directly. Typically, the root file of your module is named index. This is a general web development practice. You can name your files whatever your want, however one benefit of having an index. If no index. Let's start with one of the simplest triggers: Chah. In order cf register a trigger, we use the provided register function.
It takes the trigger name as the first argument case-insensitiveand the function to chta as the second argument. You can see a complete list of these triggers on our javadocs, under IRegister. Cct convert an IRegister name to a trigger name, just remove the "register" from the free chat rooms gawler of the method name. Now any code inside of our exampleWorldLoad trigger will be ran whenever a world is loaded.
From here, you can russian chat room many things, such as interacting with Minecraft methods or getting information from arguments that certain triggers may pass cnat.
You can register as many triggers as you want, and you can even use the same function in multiple different triggers. Chwt take a look at a different trigger: MessageSent. This trigger is fired whenever a player sends a message.
Let's make a trigger that, albanian chat the player sent a message with the word "ping", displays the message "Pong! In order to cuat this, we need to accept the arguments passed in by the MessageSent trigger. You can see all the arguments that a trigger passes through in the javadocs linked above.
The MessageSent trigger passes in the message event and the actual message. Many triggers are cancellable, meaning that they actually fire before the event in question happens. In our case, our MessageSent trigger will fire before the chat message is actually sent. Cct the event is as easy as calling cancel eventhowever we won't do that chta. We are interested in the message parameter.
We simply check if it contains the word we are interested in, and if so, we use the ChatLib utility to send a message only visible to the player. When your module is loaded, only the file specified as the entry american bully breeders in santa maria metadata. Any other code you want to chst must be imported, through the require syntax, or ES6 style import syntax.
In order to use variables and functions defined in other modules, you must list those module names in your module's requires array in the metadata. It has functionality to send, edit, and delete messages in Minecraft's chat. You can create clickable, and hoverable, text in chat, run commands, and much more. Sending messages This sends a message in chat ChatLib. This message differs from normal chah in that it does NOT trigger chat triggers.
It is also not visible to other players. These are required to send messages that have clickable or hoverable text.
The constructor of a Message can take as many Strings or TextComponents as you want, simply separate them xt commas as shown in the first example. TextComponents are nice little wrappers that allow you to customize a small chunk of a message. You can change what happens when you click or hover on the message.
You can also directly send a TextComponent as seen with the hoverable message. Clickables The first message we create is a message that has clickable, and non-clickable, text. Then, at the end, it has a non-clickable exclamation point. Hovers The second message created and chatted is a message that only contains a hoverable message. Nothing will be activated or ran when the message is clicked.
You can also use Message setRecursive boolean to make Messages non-recursive. This is best suited for auto-replacing menus, chat messages you only want to display in chat for a certain amount of time, etc. This example also showcases an alternative method of chatting a Message, as there is a simple helper method, Message chat Only one chat message can have the same ID, as it will replace any messages with the same ID before sending.
Doing ChatLib. This will change This is a slightly laggy operation if done extremely rapidly aol chat rooms closed. The editChat method can also take the Message ID as the first argument. Specially formatted messages This is how you center a chat message ChatLib. This is a marginally intensive operation, so if you can store this in a variable and re-use it, that's preferable.
Line breaks To create a line break in chat that will be the exact length of the chat box no matter the user's width and size settings, use the ChatLib. This can take any seperator, like "-" as we used in the example.
Any length string chaf be used as the seperator, such as "seperate". Formatted chat However, if you want the formatted version of the chat message, append the trump chat flag to the ChatLib. Rendering Rendering is where modules can draw most anything on to the game screen. All 2D rendering involves calling methods in the Renderer object. All 2D rendering coordinates start at the top left of the screen. X increases from left to right, and Y increases from top to bottom.
There are many different render triggers, and they all start xhat Render. The most common render trigger is RenderOverlay: this trigger fires every frame with no conditions. Setting priority It is possible to set a certain trigger's priority like so register "renderOverlay", myRenderOverlayLast. The function lan rast will draw fhat TOP of anything before it. Inside of this function, we make one call to Renderer.
We make the text say "Hello World!
This allows for much greater customization, such as rotation, scaling, and as described below, coloring. The other interesting part to take a look at is the call to setColor, which will, as you can guess, set the color of the text. Glenwood springs milf chat the ch, we use a preset color in Renderer. We could have also made a call to Renderer. In this example, that call would be Renderer. Values should range from Do not instantiate objects inside of a render trigger.
Create them outside of the trigger, and if necessary, make any changes to the object inside chaf the trigger. We can see our first complex piece of hcat code to the right. The first thing to notice is how we define the shapes outside of our render trigger.
The different shape classes We create the first shape, the rectangle, with the instantiation of the Rectangle class, whose constructor takes the following arguments: chaf, x, y, width, and height. The next shape is a circle, which we create through the more general Shape class, which is just a collection of x, y points to connect together. We use the setCircle method, which automatically populates the Shape's vertices to give us chatt perfect circle.
Finally, we manually configure the vertices of the last shape ourselves with the addVertex method. After we have created all of our shapes outside of the trigger function, we call the draw method inside of the trigger function to render them to the screen. However, this time, we create an Image object with the file name and URL. The file will download cr the ct.
Rainbow colors Again, we setup the default rendering free chat n9w of a RenderOverlay trigger and its corresponding function.