Git Product home page Git Product logo

effect-stack's Introduction

Effect-Stack

A system that stacks amplifiers of effects, while keeping durations separate.

Example:

Speed I 60s + Speed II 30s
=> Speed III 30s, followed by Speed I 30s

Usage

Basic:

Run this function as every player that has just joined the game (every time):
function effectstack:join

Apply Effect:

  1. Set "id" to the numeric effect id (supports from speed (1) to hero of the village (32), possible future effects are not supported)
    scoreboard players set id effectstack 1
  2. Set duration to the duration of the effect in ticks (20 = 1s)
    scoreboard players set duration effectstack 100
  3. Set amplifier to the amplifier of the effect (starts at 0)
    scoreboard players set amplifier effectstack 0
  4. Set sid to a "source id" scoreboard players set sid effectstack 0
  5. Run v as the player(s) you want to give the effect to:
    function effectstack:effect

Source ID:

If an effect is applied and an effect of the same ID with the same SID already exists, the old effect is overwritten with the new one. If you want to use this system but do not want to use SID, simply add scoreboard players add sid effectstack 1 at the start of the effectstack:effect function and SID will effictively be ignored.

Notes

This system will mess up effects if you give them via /effect and then give the same effect via this system

It probably is a good idea to delete any folders from effectstack:apply/tree that correspond to an effect that is not used. (they take quite a bit of space and can use too much ram)

Credit is appreciated, but not required.

effect-stack's People

Contributors

mctsts avatar

Watchers

 avatar  avatar

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.