Package org.spout.vanilla.ai.action

Examples of org.spout.vanilla.ai.action.ActionAttack


    NearbyComponentsSensor humanSensor = new NearbyComponentsSensor(getAI(), Human.class);
    humanSensor.setSensorRadius(16);
    getAI().registerSensor(humanSensor);
    getAI().registerGoal(new AttackPlayerGoal(getAI()));
    getAI().registerAction(new ActionAttack(getAI()));

    // Metadata values
    MetadataComponent meta = getOwner().add(MetadataComponent.class);
    meta.addMeta(Metadata.TYPE_BYTE, 16, VanillaData.STATE);
    meta.addBoolMeta(17, VanillaData.CHARGED);
View Full Code Here


    final NearbyComponentsSensor humanSensor = new NearbyComponentsSensor(getAI(), Human.class);
    humanSensor.setSensorRadius(10);
    getAI().registerSensor(humanSensor);
    //Go attack nearby players AI
    getAI().registerGoal(new AttackPlayerGoal(getAI()));
    getAI().registerAction(new ActionAttack(getAI()));

    // Add villager state metadata
    getOwner().add(MetadataComponent.class).addBoolMeta(16, VanillaData.WAS_VILLAGER);
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.ai.action.ActionAttack

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.