-
Notifications
You must be signed in to change notification settings - Fork 215
- 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 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 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 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 leveled up in " + event.getJob().getName() + " job!");
}
The event is called when calculating the payment.
Example
@EventHandler
public void onJobsPayment(JobsPaymentEvent event) {
event.getPlayer().sendMessage("You got " + event.get(CurrencyType.MONEY) + " 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 player's information object, use:
JobsPlayer jobsPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
Then you can get things such as their log, left times, quests, total levels and more. Remember that this method can return null
if the given player is not cached into memory.
To get player's job progression list (unmodifiable) use:
JobsPlayer jobsPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
if (jobsPlayer != null) {
List<JobProgression> jobs = jobsPlayer.getJobProgression();
for (JobProgression prog : jobs) {
// Do your stuff here
}
}
To get an unmodifiable jobs list:
Jobs.getJobs();