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

stop water from moving?

Comments in 'Plugin Development' started by dxm_hippie, May 20, 2015.

  1. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Are you going to try to make a plugin that stops water and lava? If so, it's too late. Check out BlockFreezer's code(but don't copy it, or else...)
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Have you tested it? I think getBlock returns the block NEXT TO the water block (that can be any air block) instead of the water block itself.
  3. tigerza118
    Offline

    tigerza118 Active Member

    Joined:
    Jan 31, 2015
    Posts:
    100
    Minecraft User:
    tigerza117
    Edit
    PHP:
        public function onBlockUpdate(BlockUpdateEvent $event){
            
    $id = $$event->getgetBlock()->getId();
           
                    if(
    $id === 8) {
                        
    $event->setCancelled(true);
                    }
                    if(
    $id === 9) {
                        
    $event->setCancelled(true);
                    }
                    if(
    $id=== 10) {
                        
    $event->setCancelled(true);
                    }               
                    if(
    $id === 11) {
                        
    $event->setCancelled(true);
            }
        }
  4. tigerza118
    Offline

    tigerza118 Active Member

    Joined:
    Jan 31, 2015
    Posts:
    100
    Minecraft User:
    tigerza117
  5. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    Its code from the plugin SpreadFreeze, which is an older version of BlockFreezer, and i am still using SpreadFreeze :p
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    And does SpreadFreeze work well?
    It is a wrong plugin because it cancels many events wildly.
  7. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    I only use it to stop water and lava from flowing, works as expected.

Share This Page

Advertisement