Shield System

Quick rating

Shield System

No reviews yet

a minecraft mod that provide a simple shield system

Mod Loaders
NeoForge
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

About

Project Details

Type
Mod
Latest Version
shield_system-2101.1.4.jar
Authors

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID

Resources

External Links

Source Issues Wiki Discord

About

Description

This is an independent shield system from SimpleRPG Core.

It provides a shield system similar to that of League of Legends and it has complete kubejs support.

description_e72ced56-e0d3-413e-b989-fce07ba12ee6.png

Currently adapted to Overflow Bars

for kubejs:

StartupEvents.registry("shield_system:shield_type", event => {
    //Create a simple unit shield that exists permanently
    event.create("kubejs_test_unit")
        .createSimpleUnitShield()

    //Create a simple shield group, where the unit shields of the shield group permanently exist
    event.create("kubejs_test_group")
        .createSimpleGroupShield()

    //Create a shield that lasts for 5 seconds and belongs to the shield group
    event.create("kubejs_test_time")
        .createTimeLimitedShield(20 * 5)

    //Create a shield that continuously decays within 5 seconds and belongs to the shield group
    event.create("kubejs_test_decay")
        .createDecayShield(20 * 5)


    //Next is the advanced section
    event.create("kubejs_custom_1")
        //Add shield provider
        .shieldFactory(
            //Use the unit shield constructor to provide kjs objects for the builder, making it easier to manage
            () => UnitShieldBuilder.of((initAmount) => new TestShield(initAmount))
                //tick
                .tick((kubeUnitShield, living) => {
                    kubeUnitShield.getKubeObject().tick(kubeUnitShield, living)
                })
                //save
                .save((kubeUnitShield, living) => {
                    kubeUnitShield.getKubeObject().save(kubeUnitShield, living)
                })
                //load
                .load((kubeUnitShield, living) => {
                    kubeUnitShield.getKubeObject().load(kubeUnitShield, living)
                })
                //Since it is a unit shield, a unit shield constructor should not be provided, but rather a unit shield should be provided directly. Therefore,. create (0)
                .build().create(0)
        )

    event.create("kubejs_cunstom_2")
        .shieldFactory(
            //Use shield group
            () => new GroupShield(
                   //Use the unit shield constructor to provide kjs objects for the builder, making it easier to manage
                UnitShieldBuilder.of((initAmount) => new TestShield(initAmount))
                    .tick((kubeUnitShield, living) => {
                        kubeUnitShield.getKubeObject().tick(kubeUnitShield, living)
                    })
                    .save((kubeUnitShield, living) => {
                        kubeUnitShield.getKubeObject().save(kubeUnitShield, living)
                    })
                    .load((kubeUnitShield, living) => {
                        kubeUnitShield.getKubeObject().load(kubeUnitShield, living)
                    })
                    //Since it is a shield group, there is no initial shield, so a unit shield constructor is provided here without the need for. create (0)
                    .build()
            )
        )
})


function TestShield(initAmount) {
    this.initAmount = initAmount
}

/**
 * @param {$KubeUnitShield_<TestShield} kubeUnitShield
 * @param {$LivingEntity_} living
 */
TestShield.prototype.tick = function (kubeUnitShield, living) {
    kubeUnitShield.reduceShieldAmount(this.initAmount / 100)

}

/**
 * @param {$KubeUnitShield_<TestShield} kubeUnitShield
 * @param {$LivingEntity_} living
 */
TestShield.prototype.save = function (kubeUnitShield, living) {

}

/**
 * @param {$KubeUnitShield_<TestShield} kubeUnitShield
 * @param {$LivingEntity_} living
 */
TestShield.prototype.load = function (kubeUnitShield, living) {

}
/**
 * @param {$LivingEntity_} living
 */


TestShield.prototype.sendMessage = function (living) {
    living.sendSystemMessage(this.initAmount)
}

ShieldSystemEvents.RegisterShieldPriority(event => {
    //Register shield priority, shields without registered priority will not take effect
    event.addShieldType("kubejs:kubejs_test_group")
    event.addShieldType("kubejs:kubejs_test_time")
    event.addShieldType("kubejs:kubejs_test_decay")
})

for API use

EntityEvents.afterHurt(event => {
//There are two situations to add shield values to a shield:
//If the target shield is a shield group, a unit shield will be created based on the provided shield value, and then the unit shield will be added to the shield group
//If the target shield is a unit shield, the shield value will be directly increased on the basis of the original shield value     ShieldAPI.addShieldAmount(event.entity, "kubejs:kubejs_test_decay", 80) //reduce shield ShieldAPI.reduceShieldAmount(event.entity, "kubejs:kubejs_test_decay", 40) //get shield instance var shieldInstance = ShieldAPI.getShieldInstance(event.entity, "kubejs:kubejs_test_decay") })

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

~4,000
Downloads
Last Updated
Created
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works