Skip to content

[ENHANCEMENT] Scripting system for mobs #10

@SirFancyBacon

Description

@SirFancyBacon

Objective:

implement a scripting system similar to CustomNPCs.

Purpose:
Brawlator is the first custom mobs plugin for sponge that i am aware of; adding CustomNPC-like features could possible draw many folks over to the Sponge community helping to draw new devs to further improve Sponge.

Example of CustomNPC scripting API
http://www.kodevelopment.nl/minecraft/customnpcs/scripting

Key events:
the first events the team should focus on implementing are:

damaged()
died()
attack()
tick()
timer()

this should provide most of the functionality i think most people desire in a mob scripting system.
Eventually we should find a way to implement ranged attacks and melee attacks on the same mob; then split attack() into meleeAttack() and rangedAttack()

Two other very useful features would be:
target()
targetLost()

This would help in the creation of Finite State Machines and the first step into custom AI for Brawlator.

Additional notes:
CustomNPCs has a Javascript engine spawned for each NPC. this allows you to use the same code without interfering with any global effects; I think Brawlator should follow suit for the same reason.

As such if we needed to pass events between scripting engines; two functions would be needed setTempData() and getTempData()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions