Entity Permission?

Discussion in 'Spigot Plugin Development' started by jamesd5, Jul 11, 2018.

  1. Hello, I just have a quick question.
    Lets say I just summoned a cow and cow = the spawned Entity
    SO, i could do cow.setCustomName() or something
    I am trying to give this entity a specific permission.
    Can I do this by just doing cow.haspermission("cow.perm");
    ?
    If not, how can I do it?
     
  2. Why do you want to do this? o_O
     
  3. ScarabCoder

    ScarabCoder Retired Resource Staff
    Retired

    What.

    Why exactly? Only players have permissions...
     
  4. Entities can too in theory, they extend Permissible, but I dont really understand why someone would want to use that.
     
  5. Well, I think entities can have permissions, it is just not well known, but Idk I just think this.
    I just thought I can retrieve this cow later on in the code, but I can always try a different method.
    ty
     
  6. You may want to explain what you are trying to achieve in the endgame here. Like why are you trying to give them a perm in the first place?
     
  7. Like I said, I just thought I can retrieve all cows with this perm later on in the code, but I might just use another method, I guess. :D
     
  8. Its possible with perms, yes, but I would say using metadata would be a better idea.
     
  9. If you want to get all cows, then maybe save them in a list (or their UUIDs). Individually, I think the native way to add a permission is addAttachment
     
  10. Thank you :D