-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExamplePlugin.cs
More file actions
42 lines (37 loc) · 1.13 KB
/
ExamplePlugin.cs
File metadata and controls
42 lines (37 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using QuantumMC.Plugin;
using QuantumMC.Event;
using QuantumMC.Event.Impl;
namespace ExamplePlugin
{
[Plugin(
Name = "ExamplePlugin",
Version = "1.0.0",
Authors = "xRookieFight",
Description = "Example plugin for QuantumMC"
)]
public class ExamplePlugin : PluginBase, Listener
{
public override Task OnEnable()
{
Logger.Information("ExamplePlugin has been enabled!");
RegisterListener(this);
return Task.CompletedTask;
}
public override Task OnDisable()
{
Logger.Information("ExamplePlugin has been disabled!");
return Task.CompletedTask;
}
[EventHandler]
public void OnPlayerJoin(PlayerJoinEvent @event)
{
@event.JoinMessage = "{@event.Player.Username} joined the server.";
@event.Player.SendMessage("Welcome to QuantumMC, {@event.Player.Username}!");
}
[EventHandler]
public void OnPlayerQuit(PlayerQuitEvent @event)
{
@event.QuitMessage = "{@event.Player.Username} left the server.";
}
}
}