Git Product home page Git Product logo

spells's Introduction

Spells

Java Apache Maven IntelliJ IDEA

Stars Badge Forks Badge Pull Requests Badge Issues Badge GitHub contributors License Badge

Spells is a minecraft plugin that replicates the wizard world! Please be aware some of this code is used directly from here and this version will hopefully contain more contribution updates rather than creator updates.

Contributors

Contact

Installing

  1. Download the jar from releases
  2. Put the jar in your server.
  3. Edit the configuration files to your liking. (NOTE The spells have defaulted parameters hard-coded but are mostly configurable.)

API

You can access our events from our me.steamworks.api.event.impl folder, and you can view all other api related files in me.steamworks.api

Usage

This example shows how to listen to when spells are cast.

package me.padfoot.hooks;

import me.steamworks.api.event.impl.SpellPostCastEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

class SpellsHook implements Listener {

    @EventHandler
    public void onSpellCastEvent(SpellPostCastEvent event) {
        System.out.printf("%s has casted the spell %s!%n", event.getCaster().getName(), event.getSpell().getName());
    }
    
}

This example shows you how to create your own spell (NOTE Correct packaging will be judged and noted on during a PR request, please make sure you put the spell in the correct category, e.g. charms, curses, hexes or modifiers.)

package me.steamworks.spells.impl.curse;

import me.steamworks.SpellPlugin;
import me.steamworks.Targeter;
import me.steamworks.spells.Spell;
import me.steamworks.spells.SpellInfo;
import me.steamworks.utils.WrappedParticle;
import org.bukkit.Color;
import org.bukkit.Particle;
import org.bukkit.block.Block;
import org.bukkit.entity.LivingEntity;

@SpellInfo(
        name = "Avada Kedavra",
        description = "Three make a whole.",
        cooldown = 120
)
public class AvadaKedavra extends Spell {

    // This example shows if you wish to target a specific block or entity, and you can view the different methods for summoning effects or fireworks.
    @Override
    public boolean cast(final Player player) {
        SpellPlugin.getInstance().getTargeter().register(player, new Targeter.SpellHitEvent() {
            @Override
            public void block(Block block) {
                player.sendMessage("pfft you can only use this on entities!");
            }

            @Override
            public void entity(LivingEntity entity) {
                entity.setHealth(0);
            }
        }, 1, 0.5, 2, new WrappedParticle(Particle.REDSTONE, new Particle.DustOptions(Color.GREEN, 1)));

        return true;
    }

    // This example shows if you don't want to have a target and just run the spell against the caster.
    //    @Override
    //    public boolean cast(final Player player) {
    //        player.setHealth(0);
    //        return true;
    //    }

}

Views



Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.