Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

working on a hunger games plugin for 1.4 & trickier bits

Comments in 'Plugin Development' started by VonHirst, Aug 27, 2014.

  1. VonHirst
    Offline

    VonHirst Active Member

    Joined:
    Aug 26, 2014
    Posts:
    50
    Hey guys, I’m working on a hunger games plugin for 1.4. I’m using events, timers, game state and player state, the usual stuff. I’ve mapped out the logic in a flow chart; everything fairly straight forward except for some of the trickier bits I’ve listed below:

    1. Spectator Mode: Make Player Invisible and Unable to Interact with Objects, possibly fly, teleport to players

    2. Warp players to waiting area

    3. Freeze / Unfreeze Players

    4. Enable / Disable PVP

    5. Disable destroying the environment (but able to open chests & doors)

    6. Empty and Reload Chests with Random Items

    7. Reset Map

    If anyone has any pointers / tips or sample code on how to accomplish these, much appreciated! Thanks.
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    xpyctum, iJoshuaHD and 64FF00 like this.
  3. luca28pet
    Offline

    luca28pet Active Member

    Joined:
    Feb 20, 2014
    Posts:
    251
    Minecraft User:
    luca28pet
    PHP:
    public function onEntityDamage(EntityDamageByEntityEvent $event){
       if(
    $event->getEntity()->getLevel() == "hg"){ //HG world
          
    $event->setCancelled(); /*this disable pvp, you can configure as you want, for example only when the game is not started*/
       
    }
    }
    PHP:
    public function onBlockPlace(BlockPlaceEvent $event){
       if(
    $event->getPlayer()->getLevel() == "hg"){
          
    $event->setCancelled(); //this disable placing blocks in the "hg" world
       
    }
    }
    PHP:
    public function onBlockBreak(BlockBreakEvent $event){
       if(
    $event->getPlayer()->getLevel() == "hg"){
          
    $event->setCancelled(); //this disable breaking blocks in the "hg" world
       
    }
    }
    Players will be still able to use doors and chests.

    For this you can use signs, or a command /hg start if you like:

    Just disable move event before the game starts.


    For spectator mode, I think you should put the player in creative and turn it invisible by players that are playing. For chest refill, you can use ChestRefill plugin by @Falk.

    Hope this helped ;) Will this plugin be public?
    PixelGuy75 and xFlare like this.
  4. VonHirst
    Offline

    VonHirst Active Member

    Joined:
    Aug 26, 2014
    Posts:
    50
    This is great info - will research and get back. Plugin will be 100% public.
    PEMapModder likes this.
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    @Dinokiller, where are you!
    Tuff likes this.
  6. EkiFoX
    Offline

    EkiFoX Active Member Plugin Developer

    Joined:
    Feb 28, 2014
    Posts:
    95
    Plugins:
    2
    Minecraft User:
    ekifox
    loadlevel not work :C
  7. VonHirst
    Offline

    VonHirst Active Member

    Joined:
    Aug 26, 2014
    Posts:
    50
    i'm trying to get a rudimentary map going - followed the instructions here but no dice. Server starts and looks OK, but when I connect with client (android, 095) stuck at "Building Terrain" screen with no progress on bar - not even after attempting to re-connect several times. I'm running Alpha_1.4dev-478_x86

    Goal is to use MCEdit to build the map
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    I think it is MCPE bug.
  9. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,201
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    i have been telling many of others to lower their view distance to the lowest toggle as possible and disable all graphics settings too to load things smoothly. this is what @shoghicp told me as i ran into the same problem getting stucked at building terrain.
  10. VonHirst
    Offline

    VonHirst Active Member

    Joined:
    Aug 26, 2014
    Posts:
    50
    i'll give it a shot - thanks
  11. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    Hunger games, I hope you can succeed!
  12. VonHirst
    Offline

    VonHirst Active Member

    Joined:
    Aug 26, 2014
    Posts:
    50
    Thanks for pinging the thread - I had written up some of the code, but stopped development when I realized how unstable the server was. I'm going to pick it back up when the server stabilizes.
  13. xiranoMc
    Offline

    xiranoMc New Member

    Joined:
    Dec 27, 2014
    Posts:
    2
    Minecraft User:
    xirano
  14. luca28pet
    Offline

    luca28pet Active Member

    Joined:
    Feb 20, 2014
    Posts:
    251
    Minecraft User:
    luca28pet
    PEMapModder and Jon like this.
  15. xiranoMc
    Offline

    xiranoMc New Member

    Joined:
    Dec 27, 2014
    Posts:
    2
    Minecraft User:
    xirano
    Okay thx
  16. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    When it will works?

Share This Page

Advertisement