menu
#3974755 Cannot redeclare LousWiteMC\FarmMobs\Farm::onDamage()

Submitted by PocketMine-MP 3.11.4

General information

Version: 3.11.4
Git commit: 13f28d84
Plugin involvement: Direct
Report date: 2020-03-24 08:12:09 +0000 UTC

System Information

PHP version: 7.2.16
Operating system: win
System banner: Windows NT CYBERLINK-PC 10.0 build 18362 (Windows 10) AMD64

Error information

Warning: a plugin was directly involved in this crash. Please contact the plugin author.
Message: Cannot redeclare LousWiteMC\FarmMobs\Farm::onDamage()
File: plugins/FarmMobs/src/LousWiteMC/FarmMobs/Farm
Line: #83
Error level: E_COMPILE_ERROR
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
     */
public function onSpawn(EntitySpawnEvent $event): void{
$entity = $event->getEntity();
if($entity instanceof Cow or $entity instanceof Pig or $entity instanceof Chicken or $entity instanceof Sheep or $entity instanceof Zombie or $entity instanceof ZombiePigMan){
$mobstacker = new Mobstacker($entity);
$mobstacker->Stack();
}
}

public function onDamage(EntityDamageByEntityEvent $event){
$entity = $event->getEntity();
if($entity instanceof Cow ?? $entity instanceof Sheep ?? $entity instanceof Pig ?? $entity instanceof Chicken ?? $entity instanceof Zombie ?? $entity instanceof ZombiePigMan){
$player = $event->getDamager();
if($player instanceof Player){
$mt_rand = mt_rand(1, 50); //random rồi check số random ra để làm vận may
switch($mt_rand){
case 5:
$name = $player->getName();
$this->getServer()->getCommandMap()->dispatch(new ConsoleCommandSender(), "say {$name} ngu!!!"); //lệnh console
//$player->getInventory()->addItem() ANH THÊM ITEM VÀO ĐÂY NHA!!!!!!!!!!!!

Loaded Plugins

  • Show

Server Settings

  • Show