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

NoCraft

Discussion in 'Requests' started by Groin, Jun 29, 2017.

  1. Groin

    Groin Baby Zombie

    Messages:
    159
    Hello guys,
    I need a plugin can disable craft in some worlds.
    Thanks.
     
  2. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
  3. Groin

    Groin Baby Zombie

    Messages:
    159
  4. Groin

    Groin Baby Zombie

    Messages:
    159
    Oh no... please fix it :(

    PHP:
    ErrorWinterBuild7074\NoCrafting\Main cannot implement pocketmine\plugin\PluginBase it is not an interface
    File: /NoCrafting-master/src/WinterBuild7074/NoCrafting/Main
    Line
    12
    Type
    E_ERROR

    THIS CRASH WAS CAUSED BY A PLUGIN

    Code
    :
    [
    3]
    [
    4] use pocketmine\command\CommandSender;
    [
    5] use pocketmine\command\Command;
    [
    6] use pocketmine\event\Listener;
    [
    7] use pocketmine\plugin\PluginBase;
    [
    8] use pocketmine\event\player\PlayerInteractEvent;
    [
    9] use pocketmine\Server;
    [
    10] use pocketmine\Player;
    [
    11]
    [
    12] class Main extends PluginBase implements PluginBase {
    [
    13]     
    [
    14]     public function onEnable(){
    [
    15]         $this->getServer()->getPluginManager()->registerEvents($this$this);
    [
    16]         $this->saveDefaultConfig();
    [
    17]     }
    [
    18]
    [
    19]     public function onTouch(PlayerInteractEvent $event) {
    [
    20]         $block $event->getBlock();
    [
    21]         $blocklevel $block->getLevel()->getName();
    [
    22]         $blockedcrafting $this->getConfig()->get("BlockedCrafting");
     
  5. DanielYTK

    DanielYTK Zombie

    Messages:
    227
    use:
    PHP:
    class Main extends PluginBase implements Listener
     
  6. Groin

    Groin Baby Zombie

    Messages:
    159
    Please help me do it!
     
  7. RoyalMCPE

    RoyalMCPE Slime

    Messages:
    87
    Redowload the plugin, @WinterBuild7074 fixed it
     
    Groin likes this.
  8. Groin

    Groin Baby Zombie

    Messages:
    159
    Oh... It doesn't work
     
  9. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    I'll fix the plugin as soon as possible. I think tomorrow.
     
  10. Groin

    Groin Baby Zombie

    Messages:
    159
    Have you fixed? Because it sill not working
     
  11. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    You cant cancel crafting, the client handles the GUI.
     
  12. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
  13. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
  14. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
     
  15. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    they can also simply just get use their personal GUI...
    shouldn't there be some event for these kind of occasions?
    blocking item begin transformed?
     
  16. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    Why does the event not get cancelled, then? I'm using PlayerInteractEvent on CraftingTable Blocks.
     
  17. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    Because you cant!
     
    EdwardHamHam likes this.
  18. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    @WinterBuild7074 What @TheDiamondYT is trying to tell you is that it's impossible to cancel the event of a player opening the menu of a crafting table. This is because it's a client-sided thing, and can't be stopped by the server. So therefore the plugin fails, since you're trying to do something that can't be done.
     
  19. WinterBuild7074

    WinterBuild7074 Zombie Pigman

    Messages:
    693
    GitHub:
    winterbuild7074
    OK, that means if someone asks for a plugin that blocks crafting, I can say that it's impossible to make one, because it's all client-sided?
     
  20. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    Exactly.
     
  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.