1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

A ui within Villager

Discussion in 'Plugin Help' started by Exconic, Jul 18, 2020.

  1. Exconic

    Exconic Spider

    Messages:
    14
    GitHub:
    poyq
    Hello, I've seen a server with villagers but they have a Villager ui not a normally one with FormAPI i was wondering if there is any api or way to create one?
     
  2. Willoxey

    Willoxey Spider Jockey

    Messages:
    33
    Search for UpdateTradePacket and BaseInventory
     
  3. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    Yes, its simple to create, so there is a lot ways to do it, first way: you need to complete a hard missions (Joke Lol) but in second way: you need to create it in EntityDamageByEntity.
     
  4. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    also you can spawn Villager entity owne your self and use some thing like this :
    PHP:
    //for example you spawned an entity Villager with (Villager) name
    if ($event->getEnetity() instanceof Villager) {
    //its for dont damage villager when you click on it.
    $event->setCancelled(true);
    $this->openTradeForm($event->getPlayer());
    //its for opening forms when you click on Villager

    //you need to create a function called OpenTradeForm(Player $player) {
    //here is for buttons and more
    }

    //also its better to use EntityDamage like:
    if ($event->getEntity() instanceof Villager) {
    $event->setCancelled(true);
    // its for when player wants to greif or kill villager with lava or fire XD
    }
    }
    and its done. ;)
     
  5. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    also you can spawn a entity (with spaller) and set your sking to Villager and dispatchcommand XD its simple way.
     
  6. Taco

    Taco Spider Jockey

    Messages:
    41
    GitHub:
    taconoburrito
    im suprised you dont need to use a api for it?
     
  7. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    ME?!
     
  8. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    its example, if you dont know how to use api, you should first learn php, then asking here, and im for this just sent Code and my own idea to do that, there is more than 10 way to create this plugin in my mind and i told 3 of 10 my ideas to him/her :p
     
  9. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    You need more help?! tag me here, i'll code free for you, np ;)
     
  10. hexmor

    hexmor Baby Zombie

    Messages:
    110
    GitHub:
    h3xmor
    there is an api in poggit for that but i just forgot the name . search villager in dev
     
  11. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    oh Wait, thats not by formapi!? is it GUI (mqusit inv) ?!
     
  12. JviguyGamesYT

    JviguyGamesYT Baby Zombie

    Messages:
    113
    GitHub:
    jviguy
    it could also be the new npc forums he didnt really specify
     
  13. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    He dosnt anwser, what is his problem, give up this thread :p
     
  14. Exconic

    Exconic Spider

    Messages:
    14
    GitHub:
    poyq
    thanks for the help resolved
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.