[Discontinued] 🛠 ActionControl [v1.1] - Control crafting, mining, combat and more!

This plugin is no longer up to date and probably won’t be updated.

ActionControl allows you to react on almost every action performed by a player on your server.
With ActionControl you can currently react on the following actions:

  • Crafting items
  • Breaking blocks
  • Placing blocks
  • Interacting with blocks
  • Interacting with entities
  • Attacking entities
  • Using items

When one of the listed actions is performed, you can respond to it in one of the following ways:

  • Deny the action
  • Execute a command
  • Log the action

:mag: Ore page (includes download and documentation)
:floppy_disk: Alternative download (if Ore is down)

4 Likes

v1.0.1 was released!


This fixes a bug that caused the default config file to not be generated correctly.

This plugins sounds interesting. Time to try it out, i guess :slight_smile:

would be nice if this or a plugin like it could extend a bit further into even controlling what can/can not be taken out of creative mode.

You can already create rules that apply only to players in creative mode:

player-filter = "{'gamemode': 'creative'}",
action-rules {
    # The following rules only apply to players in creative mode
    ...
}

However, you can’t remove specific items from the creative mode inventory, but you can deny the usage of these items.
For example, if you want to ban the usage of Spawn Eggs in creative mode, just create a rule that blocks players from interacting with a Spawn Egg.

do i need to make a rule for each and every item/block or can it be done in list form or something?, example of a few blocks/items using that please. believe i’m getting an understanding by looking at the config examples found here

https://ore-staging.spongepowered.org/Milchshakee/ActionControl/pages/Configuration

but how would you combine these together?

craft {
    filter {
        result = "{'type': 'minecraft:fire_charge', 'quantity': 3}"
    },
    response {
        match = "deny"
    }
},

craft {
    filter {
        result = "{'type': 'minecraft:firework_charge', 'quantity': 1}"
    },
    response {
        match = "deny"
    }
},

craft {
    filter {
        result = "{'type': 'minecraft:fint_and_steel', 'quantity': 1}"
    },
    response {
        match = "deny"
    }
}

and also by interacting with spawn egg; would that mean that they wouldnt be able to take it from the creative menu and putting it in their inventory? I don’t exactly mean remove it from creative mode; what I’m looking for is to block it from being taken out of the creative window and thrown on the ground; or put in the invetory, etc. like it blocks their ability to interact with the item in creative mode alltogether. like creativecontrol did.

Yes, you can shorten the rule by using the or conjunction ( | ) and omitting the quantity property.

craft {
    filter {
        result = "{'type': 'minecraft:fire_charge' | 'minecraft:firework_charge' | 'minecraft:flint_and_steel'}"
    },
    response {
        match = "deny"
    }
}

By interacting I meant right clicking with it to spawn a mob. It is currently not possible to deny moving an item out of your inventory.

I don’t think that adding support for this kind of action would be good, since ActionControl is already pretty complex and handling inventory action as well would make it even more complex.
Using a separate plugin for this would be a better solution, although I’m not sure if there is already one.

I just released version 1.0.3, which fixes some crafting rule bugs.
You can download it on GitHub but not on Ore since it currently doesn’t let me upload new versions :frowning:

ah ok; well it keeps telling me my configs are wrong so i’ll update and see if it fixes it but idk

Your block matcher for an obsidian block is wrong. This is the correct matcher:

interact-with-block { filter: { block = "{'state': {'type': {'id': 'minecraft:obsidian'}}}", item = "{'type': 'minecraft:flint_and_steel' | 'minecraft:fire_charge'}" }, response { match = "deny" } },

As the documentation states, you need a block matcher for the interact-with-block rule. The state property of this block matcher is a block state matcher and differs from item stack matcher that you used.

At first, this is a bit confusing but when you get it, it seems reasonable. :slight_smile:

ah well i believe this needs updated down toward the global examples:
https://ore-staging.spongepowered.org/Milchshakee/ActionControl/pages/Configuration

player-filter = “{‘permissions’: !{‘admin.permission’: true}, ‘location’: {‘world’: {‘dimension’: {‘name’: ‘overworld’}}}}”
action-rules {
interact-with-block {
filter: {
block = “{‘state’: {‘type’: ‘minecraft:obsidian’}}”,
item = “{‘type’: ‘minecraft:flint_and_steel’}”
},
response {
match = “deny”
}
}

Yeah I will correct this right away.

disallowing crafting of something works, but when you spam click the item several times, it will eventually be crafted. Is this avoidable?

Also there seems to be a bug with eating stuff. The default generated example file disallowed eating of fish however players were disallowed to eat anything including steaks, and potions.

simple solution: Delete the default config. :stuck_out_tongue:
If you want my file brotha i’ll send it to you on discord. just lemi know if you need it.

I know I should delete the default config lol, but say if I wanted to really disable eating fish, then it would be a problem. Just stating that there’s a bug XD

I will look into this.

I tested eating cooked fish and I couldn’t do it as expected. Note that the example denies eating cooked fish, not just raw fish.

I also tested the crafting bug and indeed you can bypass it by clicking madly.
But I’m pretty sure this is a Sponge related bug and I reported it on the issue tracker
The implementation of the Inventory API in SpongeForge seems a bit buggy right now and will hopefully get fixed soon.

I also stumbled upon a random NPE and I will fix this in a new version.

Yup, it denied eating cooked fish but everyone was denied to eat any type of food including steak and even potions. So there must be something wrong.

Yep, there was something wrong, it was the rule in the example configuration. The new version v1.0.5 will now generate a correct example config. You can view the fixed config here.