[Développement Spigot] Problème avec des évenements

xam4lor Messages postés 17 Date d'inscription   Statut Membre Dernière intervention   -  
xam4lor Messages postés 17 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,

je développe en ce moment un plugin minecraft grâce à l'API Spigot.

Pourquoi ces évenements ne marchent-ils pas ?

@Override
public void onEnable() { //activation du plugin
    partieBegin = false;
    this.log.info("[TaupeGun] " + "Plugin actived");
}
 
@Override
public void onDisable() { //desactivation du plugin
    this.log.info("[TaupeGun] " + "Plugin disable");
}
 
@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
    if (partieBegin == false) {
        event.setCancelled(true);
    }
}
 
@EventHandler
public void onBlockPlace(BlockPlaceEvent event) {
    if (partieBegin == false) {
        event.setCancelled(true);
    }
}
 
@EventHandler
public void onEntityDamage(EntityDamageEvent event) {
    if (partieBegin == false) {
        event.setCancelled(true);
    }
}
 
@EventHandler
public void PlayerInventoryOpen(InventoryOpenEvent event){
    this.log.info("Okay");
}

Merci d'avance !

1 réponse

xam4lor Messages postés 17 Date d'inscription   Statut Membre Dernière intervention  
 
Pour information la variable partieBegin est bien définie:
boolean partieBegin false;
0