Skip to content

Commit

Permalink
crafts item context.click_type
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed May 20, 2021
1 parent 88a68e0 commit 292ad83
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Expand Up @@ -41,6 +41,7 @@ public class PlayerCraftsItemScriptEvent extends BukkitScriptEvent implements Li
// <context.amount> returns the amount of the item that will be crafted (usually 1, except when shift clicked. Can be above 64).
// <context.recipe> returns a ListTag of ItemTags in the recipe.
// <context.recipe_id> returns the ID of the recipe that is being crafted.
// <context.click_type> returns an ElementTag with the name of the click type. Click type list: <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/ClickType.html>
//
// @Determine
// ItemTag to change the item that is crafted.
Expand Down Expand Up @@ -116,6 +117,9 @@ else if (name.equals("amount")) {
}
return new ElementTag(amount);
}
else if (name.equals("click_type")) {
return new ElementTag(event.getClick().name());
}
else if (name.equals("recipe")) {
ListTag recipe = new ListTag();
for (ItemStack itemStack : event.getInventory().getMatrix()) {
Expand Down
Expand Up @@ -32,7 +32,7 @@ public class PortalCreateScriptEvent extends BukkitScriptEvent implements Listen
// @Context
// <context.entity> returns the EntityTag that created the portal.
// <context.world> returns the WorldTag the portal was created in.
// <context.reason> returns an ElementTag of the reason the portal was created. (FIRE or OBC_DESTINATION)
// <context.reason> returns an ElementTag of the reason the portal was created. (FIRE, NETHER_PAIR, END_PLATFORM)
// <context.blocks> returns a ListTag of all the blocks that will become portal blocks.
//
// -->
Expand Down
Expand Up @@ -61,6 +61,7 @@ public class ItemScriptContainer extends ScriptContainer {
// # This demonstrates how to add a custom attribute modifier.
// attribute_modifiers:
// # One subkey for each attribute you want to modify.
// # Valid attribute names are listed at https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/Attribute.html
// generic_armor:
// # Each attribute can have a list of modifiers, using numbered keys. They will be applied in numeric order, low to high.
// 1:
Expand Down

0 comments on commit 292ad83

Please sign in to comment.