How i can make logs?

Discussion in 'Plugin Development' started by Theodossis, Sep 19, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Theodossis

    How i can make logs of my protect plugin so i see who placed blocks? I want a method.
    Thanks, Theodossis
     
  2. Offline

    Zumpz

    Use MySQL to save who have placed the blocks, and maybe break them?
     
  3. Offline

    Cr4zy[Box]

    how to make it ..? and i wanna doo this:

    -When player is in creative and placed some blocks , when he gets back to survivle i dont want him to be able to destroy those blocks.. possible?

    can help me? :p

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  4. Offline

    Zumpz

    Code:java
    1.  
    2. public void onPlayerPlaceBlock (BlockPlaceEvent e){
    3. Player player = e.getPlayer();
    4. if(player.getGameMode()==GameMode.CREATIVE){
    5. player.sendMessage(ChatColor.YELLOW + "Your gamemode is CREATIVE, switching to SURVIVAL");
    6. player.setGameMode(0);
    7. e.setCancelled(true);
    8. }
    9. }
    10.  
     
  5. Offline

    Cr4zy[Box]

    hmm i didnt meaned that, but .. how can i unable him to place blocks? (i want to unable him to place ores in creative)
     
  6. Offline

    Zumpz

    Code:java
    1.  
    2. public void onPlayerPlaceBlock (BlockPlaceEvent e){
    3. Material block = e.getBlock().getType();
    4. Player player = e.getPlayer();
    5. if(player.getGameMode()==GameMode.CREATIVE){
    6. if(block == Material.DIAMOND_ORE || block == Material.GOLD_ORE || block == Material.IRON_ORE || block == Material.REDSTONE_ORE || block == Material.LAPIZ_ORE){
    7. e.setCancelled(true);
    8. }
    9. }
    10. }
    11.  

    Like this? When you place a block and you are in CREATIVE will this cancel the event.
    If you will don't let the player not place blocks you don't let them want, get the block and check if the block is this.
     
  7. Offline

    Cr4zy[Box]

    noo, i m working in a poject but if u tell me how to unable to place a specific block it will solve it :p
     
  8. Offline

    Zumpz

    Check the post now, I put in the ore blocks
     
    Cr4zy[Box] likes this.
  9. Offline

    turt2live

    So AntiShare?
     
  10. Offline

    Cr4zy[Box]

    xD and maybe a last thing, i wont ask more xd ty for the help. how to clear players inventory?

    nope, i didnt saw any mod like mine :p maybe its a stupid mod but i think its cool

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  11. Offline

    turt2live

    player.getInventory().clear();

    I made AntiShare, and trust me it supports per-GameMode blocks, meaning a survival player can't break a block placed by a creative player.
     
  12. Offline

    Cr4zy[Box]

    yeah but i did what i wanted ty for the code btw :)
     
Thread Status:
Not open for further replies.

Share This Page