-
Notifications
You must be signed in to change notification settings - Fork 216
- JobsAreaSelectionEvent
- JobsChunkChangeEvent (cancellable)
- JobsExpGainEvent (cancellable)
- JobsJoinEvent (cancellable)
- JobsLeaveEvent (cancellable)
- JobsLevelUpEvent (cancellable)
- JobsPaymentEvent (cancellable)
- JobsPrePaymentEvent (cancellable)
- JobsScheduleStartEvent (cancellable)
- JobsScheduleStopEvent (cancellable)
The event is called when selected an area with the specified item.
Example
@EventHandler
public void onJobsAreaSelection(JobsAreaSelectionEvent event) {
event.getPlayer().sendMessage("You have successfully selected the area in high and low location: " + event.getArea().getHighLoc() + " " + event.getArea().getLowLoc());
}
The event is called when the chunk has changed.
Example
@EventHandler
public void onJobsChunkChange(JobsChunkChangeEvent event) {
event.getPlayer().sendMessage("The new chunk is: " + event.getNewChunk());
}
The event is called when a player gain exp from job.
Example
@EventHandler
public void onJobsExpGain(JobsExpGainEvent event) {
event.getPlayer().sendMessage("You got " + event.getExp() + " amount exp in job " + event.getJob().getName());
}
The event is called when a player join to a specified job.
Example
@EventHandler
public void onJobsJoin(JobsJoinEvent event) {
event.getPlayer().getPlayer().sendMessage("You have successfully joined to " + event.getJob().getName() + " job!");
}
The event is called when a player left from a specified job.
Example
@EventHandler
public void onJobsLeave(JobsLeaveEvent event) {
event.getPlayer().getPlayer().sendMessage("You have successfully left from " + event.getJob().getName() + " job!");
}
The event is called when a player leveled up in that job.
Example
@EventHandler
public void onJobsLevelUp(JobsLevelUpEvent event) {
event.getPlayer().getPlayer().sendMessage("You have successfully leveled up in " + event.getJobName() + " job!");
}
The event is called when calculating the payment.
Example
@EventHandler
public void onJobsPayment(JobsPaymentEvent event) {
event.getPlayer().sendMessage("You got " + event.getAmount() + " money!");
}
Event fired, before the payment calculation process should beginning.
Example
@EventHandler
public void onJobsPrePayment(JobsPrePaymentEvent e) {
e.getPlayer().sendMessage("Payment event is cancelled in " + e.getJob().getName() + " job!");
e.getPlayer().sendMessage("You not get any income for doing actions.");
e.setCancelled(true);
}
The event is called when started the schedule.
Example
@EventHandler
public void onJobsScheduleStart(JobsScheduleStartEvent ev) {
if (e.getSchedule().isStarted()) {
Bukkit.getLogger().log(Level.INFO, "The scheduler has started.");
}
}
The event is called when stopped the schedule.
Example
@EventHandler
public void onJobsScheduleStop(JobsScheduleStopEvent ev) {
if (e.getSchedule().isStoped()) {
Bukkit.getLogger().log(Level.INFO, "The scheduler has stopped.");
}
}
To get players job information:
JobsPlayer jobsPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
Then you can get things such as their log, left times, quests, total levels and more
To get players job list use:
List<JobProgression> jobs = Jobs.getPlayerManager().getJobsPlayer(player).getJobProgression();
for (JobProgression prog : jobs) {
// Do your stuff here
}
Or this if player is offline:
List<JobProgression> jobs = Jobs.getPlayerManager().getJobsPlayerOffline(player).getJobProgression();
for (JobProgression prog : jobs) {
// Do your stuff here
}
To get job list:
Jobs.getJobs();