Vanilla Mechanic Request
bookerthegeek opened this issue · 7 comments
Issue Description:
I would love to make some recipes require XP to craft.
What happens:
I can not create recipes that require experience.
What you expected would like to happen:
Create recipes that require experience.
Script used
I was thinking of either one of the two options:
- Add an in an XP handlers , maybe something alongs the lines of
//OutputStack, InputXP, InputArray
which might look something like below, the 5 is the levels of experience required to craft, and if you don't have enough then no craft for you. (I have no idea if this is possible or not.)
recipes.addExperienceShaped(<minecraft:iron_leggings>, 5, [
[<minecraft:iron_ingot>, <minecraft:iron_ingot>, <minecraft:iron_ingot>],
[<minecraft:iron_ingot>, null, <minecraft:iron_ingot>],
[<minecraft:iron_ingot>, null, <minecraft:iron_ingot>]]);
- The other Idea I had was opening the vanilla Handler for the Anvil. I imagine something along the lines of
//OutputStack, ParentStack, ChildStack, InputXP
for example turning lead into gold with lapis and 25 levels of experience.
recipes.addAnvil(<minecraft:diamond_block>, <ore:blockLead>, <ore:gemLapis>, 25
Affected Versions (Do not use "latest"):
- Minecraft: Would it be to much to hope for 1.10.2?
Already done ;)
recipes.addShapeless(<minecraft:stone_pickaxe>, [<minecraft:stone_pickaxe>.anyDamage().marked("pick"), <minecraft:cobblestone>], function(output, inputs, crafting) {
if crafting.player.xp > 5 {
return inputs.pick.withDamage(max(0, inputs.pick.damage - 25));
}
return null;
}, function(output, crafting, player){
player.removeXP(5);
});
Quick question... Where would I look to find what else can go into crafting.player.xp
& player.removeXP
Sniffly, after all that time I thought that through, and making it look pretty it already existed.
Wait!
Can I throw blaze rod into a cauldron of cold/hot water/"mod added liquid" I turn it into some other liquid?
or if they player has a Y >32
This one I'm curious about, how do you do this?
I know how to do the day thing, you'd do something like crafting.dimension.isDay
to check if it's day right? Brightness level I spotted too, but it required position and I couldn't work out how to get that off the player object. If I could figure out how to get the player as an entity it'd be easy as those have position exposed, but I couldn't find a way to do that.