🪛 Developer API

Events

  • JobJoinEvent - Called when player is about to join a job. Cancellable.

  • JobLeaveEvent - Called when player is about to leave a job. Cancellable.

  • JobLevelDownEven - Called when player downgraded job level.

  • JobLevelUpEvent - Called when player leveled up in a job.

  • JobObjectiveIncomeEvent - Called when job's objective is about to produce some currency. Cancellable.

  • JobObjectiveXPEvent - Called when job's objective is about to produce job XP. Cancellable.

  • JobPrePaymentEvent - Called when plugin calculates job payment amount for a player. Cancellable.

  • JobPaymentEvent - Called when plugin is about to pay player for their job. Cancellable.

  • JobXPGainEvent - Called when player is about to obtain XP for a job. Cancellable.

  • JobXPLoseEvent - Called when player is about to lose job XP. Cancellable.

Accessing Data

// Currency management.
CurrencyManager currencyManager = JobsAPI.getCurrencyManager();
Currency currency = currencyManager.getCurrency(String id);

// User data management.
UserManager userManager = JobsAPI.getUserManager();
JobUser user = userManager.getUserData(Player player);
JobUser user = userManager.getUserData(UUID playerId);
JobUser user = userManager.getUserData(String playerName);

// Async user access.
userManager.getUserDataAsync(UUID playerId);
userManager.getUserDataAsync(String playerName);

// Or (recommended)
userManager.getUserDataAndPerformAsync(UUID playerId, Consumer<JobUser> consumer);
userManager.getUserDataAndPerformAsync(String playerName, Consumer<JobUser> consumer);


// Job management.
JobManager jobManager = JobsAPI.getJobManager();
Job job = jobManager.getJobById(String id);
Collection<Job> jobs = jobManager.getJobs();

// Zone management.
ZoneManager zoneManager = JobsAPI.getZoneManager();
Zone zone = zoneManager.getZoneById(String id);
Zone zone = zoneManager.getZoneByLocation(Location location);
Zone zone = zoneManager.getZone(Block block);
Zone zone = zoneManager.getZone(Entity entity);

Last updated