Solved villager jobs

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Muya

New Member
Jul 26, 2022
5
0
1
24
how to prevent peasants from changing professions. For example, when a peasant takes the profession of a blacksmith, I do not want him to leave this profession in any way that he will remain in the profession of a blacksmith until he dies.
 
how to prevent peasants from changing professions. For example, when a peasant takes the profession of a blacksmith, I do not want him to leave this profession in any way that he will remain in the profession of a blacksmith until he dies.
have no idea rn to do that in skript, but you could just lock that by trading with him once
 
With skript-reflect cancel VillagerCareerChangeEvent when the Reason is LOSING_JOB.
 
Code:
import:
    org.bukkit.event.entity.VillagerCareerChangeEvent

on VillagerCareerChangeEvent:
    if "%event.getReason()%" is "LOSING_JOB":
        event.setCancelled(true)

This should do the job.
 
Code:
import:
    org.bukkit.event.entity.VillagerCareerChangeEvent

on VillagerCareerChangeEvent:
    if "%event.getReason()%" is "LOSING_JOB":
        event.setCancelled(true)

This should do the job.
thank youuuu
 
Status
Not open for further replies.