Solved Why EntityType.fromName(name) is deprecated?

Discussion in 'Spigot Plugin Development' started by __MainStrin, Jan 25, 2020.

Thread Status:
Not open for further replies.
  1. I have string "SHEEP" from config.yml and I want to get EntityType from this, but function EntityType.fromName() is deprecated. What should I do?
     
  2. It is deprecated because it can return magic values (as ist sais in the description).
    Use EntityType.valueOf(); since the name in your config seems to match the enum-constant exactly
     
    • Friendly Friendly x 1
Thread Status:
Not open for further replies.