-
Notifications
You must be signed in to change notification settings - Fork 0
Create a simple template
AlignedCookie88 edited this page Mar 18, 2023
·
2 revisions
By following this guide you will be able to create a template that displays a join message.
from mcdfpy.template import Template # Import the Template class
from mcdfpy.blocks import PlayerEvent_Join, PlayerAction_SendMessage # Import the classes for Player Event > Join and Player Action > SendMessage
from mcdfpy.variables import TextVariable # Import the class for a text item
template = Template("Simple Join Message") # Create a template with the name "Simple Join Message"
template.add_block(
PlayerEvent_Join() # Add a join event to the template
)
template.add_block(
PlayerAction_SendMessage(
TextVariable(name="&8[&2+&8] &a%default") # Create a text and add it to the SendMessage's chest
) # Add the SendMessage to the template
)
Well done! You have successfully created a template. To import it to DiamondFire, see the page on the Recode Item API Interface.
A python library to create code for the Minecraft server DiamondFire (https://mcdiamondfire.com).