Origins/Apoli power support
WachumaFox opened this issue ยท 8 comments
Describe the feature
I think it would be very cool to make it so only those with a power from origins/apoli could fell trees? And anyone who is lacking the power cant do it
Something like
fallingtree:treefeller
I guess what could be done, to provide an enchantment like suggested in #99.
This way you/FallingTree could write a power based on the enchant being present or not (something like no_shield power).
Though this needs to have the enchant variant available first. I think I'll go an make it, but still need to think how in the details.
You should be able to define this power to deny the use of enchanted tools. (untested)
{
"type": "origins:prevent_item_use",
"item_condition": {
"type": "origins:enchantment",
"enchantment": "fallingtree:chopper",
"comparison": ">=",
"compare_to": 1
}
}
I don't really know how that mod works, but I assume that you have to use that power in the "origins" as well. So I'm not too sure if this makes sense to include the power directly in FallingTree (as you'd need to edit/make origins elsewhere).
However if the power above makes sense and is usable elsewhere to be included in origins, I'm willing to include it directly in FallingTree so that it can be referenced directly as fallingtree:deny_chopper
power.
The "bad" thing is that it seems it can only be used as a "prevent chopping" power. Doing the opposite, granting the ability to chop, would make it so that FallingTree needs that other mod to be present and I don't want to impose that on everyone.
Oh no, I am so so so sorry, I had a whole response typed out and I totally forgot to hit comment!
While the workaround for that power deny_chopper is kind of the opposite of what im working to achieve, i actually think I could make that work by giving every origin deny_chopper except for the one I would like to have keep the power to do it!
Alternatively, now that I think of it, I wonder if you could make it a tag instead of a power, so anyone could potentially use it with or without apoli/origins?
/tag @s add denyChopper
Yeah it indeed is the opposite, but I'm not sure it is doable the other way around. From what I understood in Origins wiki is that the normal behavior is the default (so chopping is default) and then the powers modify that default (in that case block the enchanted item).
Honestly I don't know at all how that whole Origins thing works ๐ If you have something working, it can be included, but as I don't use it at all those concepts are quite abstract to me.
What I see on the readme is a inTag condition:
"condition": {
"type": "origins:in_tag",
"tag": "minecraft:skeletons"
}
So maybe this can be adjusted to have a tag that is custom, like the denyChopper you mention.
Can it be used at the same time as the item condition ?
Maybe with something like :
{
"type": "origins:prevent_item_use",
"condition": {
"type": "origins:and",
"conditions": [
{
"type": "origins:in_tag",
"tag": "minecraft:denyChopper"
},
{
"type": "origins:prevent_item_use",
"item_condition": {
"type": "origins:enchantment",
"enchantment": "fallingtree:chopper",
"comparison": ">=",
"compare_to": 1
}
}
]
}
}
However I think the problem will be the same, the power has to be granted. What you'd want is basically a power that is activated by default. But I saw no way of doing this.
By the way I think the power I posted in earlier comment won't work. As I read again the wiki I think it needs to be something like :
{
"type": "origins:prevent_item_use",
"condition": {
"item_condition": {
"type": "origins:enchantment",
"enchantment": "fallingtree:chopper",
"comparison": ">=",
"compare_to": 1
}
}
}
Hmmm, kind of what I'm going for- but I am pretty sure I could make what I'm needing with either a deny_chopper power or a tag that denies the chopper, if at all possible and not too big of an issue to add in?
(by tag, I mean this , so i don't think your example would work necessarily, I do know of ways to make what I'm needing work if you were able to easily add in the tag or power to the mod!)
So what I would do was assign everyone that wasn't in the Lumberjack class the /tag @s denyChopper (With an action on callback power)
or give every origin the power fallingtree:deny_chopper , which would mean nobody could use the chopper ability unless they chose the lumberjack
Oh ok for the tag, I indeed misunderstood. And yeah in that case it'd totally not be linked at all to Origins. That indeed sounds interesting and could be used for everyone to limit the mod effect per player if they desire.
I'll look into it to see how it's done but I think it's doable.
I didn't try it but had a shot at it. You can try a dev version from the build (you'll see an artifact mod-file at the bottom, the jar file is inside it).