Development Assistance Mods FakePlayers Events

Discussion in 'Plugin Help/Development/Requests' started by Majestcx, Dec 17, 2014.

Thread Status:
Not open for further replies.
  1. Hello, I have a problem, you know what is the event to recognize as Fakeplayers
    [BuildCraft], [CoFH] etc?

    I have tried using "public void onPlayerInteract (PlayerInteractEvent event) {}" by entering:
    Code:
            Player Mj = Bukkit.getServer().getPlayer("Majestcx");
            Mj.sendMessage("Display name: " + event.getPlayer().getDisplayName());
            Mj.sendMessage("Custom name: " + event.getPlayer().getCustomName());
            Mj.sendMessage("Name: " + event.getPlayer().getName());
            Mj.sendMessage("Player Address: " + event.getPlayer().getAddress());
            Mj.sendMessage("Player Entity ID: " + event.getPlayer().getEntityId());
            Mj.sendMessage("Player UUID: " + event.getPlayer().getUniqueId());
    But I didn't recive the FakePlayer info when it break/place a block.
    How can I do it?

    Thank you and sorry for my english..
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Majestcx If they even throw events like that
     
  3. @timtower
    For example AuthME reloaded and GriefPrevention can stop their event..
     
  4. Offline

    timtower Administrator Administrator Moderator

    @Majestcx Lets start again: what do you want to recognize?
     
  5. Oh, sorry, the right click of Autonomous Activator (FakePlayer: [CoFH])
     
  6. Offline

    timtower Administrator Administrator Moderator

    Lets start with this: what kind of events are they throwing in the first place?
     
  7. Place or shoot with a gun
     
  8. Offline

    timtower Administrator Administrator Moderator

    That are actions, not events.
     
  9. So, interact with a block... Like up, PlayerInteractEvent and I try also EntityInteractEvent
     
  10. Offline

    timtower Administrator Administrator Moderator

    Listen for Event, just as general as possible, then print the name of the event class and go on from there
     
  11. Could you write me an example?
     
  12. Offline

    timtower Administrator Administrator Moderator

    Code:
    @EventHandler
    public void onEvent(Event event){
    System.out.println(event.getClass().getName());
    }
    If java actually excepts that though
     
  13. Ok, now the plugin get an Event, with LeftClick, but nothing with RightClick

    org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event org.bukkit.event.Event
     
    Last edited by a moderator: Dec 17, 2014
  14. Offline

    timtower Administrator Administrator Moderator

    @Majestcx Was semi-expecting the last one. But I am gonna leave it with my support here.
    I don't support mods that much.
     
  15. Ok, but the last question, there are events like "onBlockInteract" or "onEntity.." etc.. ?
     
  16. Offline

    timtower Administrator Administrator Moderator

  17. Like this ?
    Code:
       
        @EventHandler
        public void onPlayerEvent(PlayerEvent event){
            Player mj = Bukkit.getServer().getPlayer("Majestcx");
            mj.sendMessage(event.getEventName());
        }
       
        @EventHandler
        public void onBlockEvent(BlockEvent event){
            Player mj = Bukkit.getServer().getPlayer("Majestcx");
            mj.sendMessage(event.getEventName());
        }
     
  18. Offline

    timtower Administrator Administrator Moderator

    @Majestcx For example. Last message on this thread support wise from me.
     
  19. Thank you for your time, I have talk with mod creator and he hadn't insert the code for recognize right click, so I couldn't do nothing..

    Could you close it?
     
  20. Offline

    timtower Administrator Administrator Moderator

    Locked on request
     
Thread Status:
Not open for further replies.

Share This Page