mirror of
https://github.com/AtlasMediaGroup/Scissors-Website.git
synced 2025-02-22 03:00:37 +00:00
1449 lines
146 KiB
HTML
1449 lines
146 KiB
HTML
<!DOCTYPE HTML>
|
|
<html lang="en">
|
|
<head>
|
|
<!-- Generated by javadoc (17) -->
|
|
<title>ItemStack (Scissors-API 1.19.4-R0.1-SNAPSHOT API)</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<meta name="description" content="declaration: package: org.bukkit.inventory, class: ItemStack">
|
|
<meta name="generator" content="javadoc/ClassWriterImpl">
|
|
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
|
|
<link rel="stylesheet" type="text/css" href="../../../script-dir/jquery-ui.min.css" title="Style">
|
|
<link rel="stylesheet" type="text/css" href="../../../jquery-ui.overrides.css" title="Style">
|
|
<script type="text/javascript" src="../../../script.js"></script>
|
|
<script type="text/javascript" src="../../../script-dir/jquery-3.6.0.min.js"></script>
|
|
<script type="text/javascript" src="../../../script-dir/jquery-ui.min.js"></script>
|
|
</head>
|
|
<body class="class-declaration-page">
|
|
<script type="text/javascript">var evenRowColor = "even-row-color";
|
|
var oddRowColor = "odd-row-color";
|
|
var tableTab = "table-tab";
|
|
var activeTableTab = "active-table-tab";
|
|
var pathtoroot = "../../../";
|
|
loadScripts(document, 'script');</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
<div class="flex-box">
|
|
<header role="banner" class="flex-header">
|
|
<nav role="navigation">
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
<div class="top-nav" id="navbar-top">
|
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
|
<li><a href="../../../index.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="nav-bar-cell1-rev">Class</li>
|
|
<li><a href="class-use/ItemStack.html">Use</a></li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../index-all.html">Index</a></li>
|
|
<li><a href="../../../help-doc.html#class">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="sub-nav">
|
|
<div>
|
|
<ul class="sub-nav-list">
|
|
<li>Summary: </li>
|
|
<li>Nested | </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor-summary">Constr</a> | </li>
|
|
<li><a href="#method-summary">Method</a></li>
|
|
</ul>
|
|
<ul class="sub-nav-list">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor-detail">Constr</a> | </li>
|
|
<li><a href="#method-detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
|
|
<input type="text" id="search-input" value="search" disabled="disabled">
|
|
<input type="reset" id="reset-button" value="reset" disabled="disabled">
|
|
</div>
|
|
</div>
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
|
</header>
|
|
<div class="flex-content">
|
|
<main role="main">
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
<div class="header">
|
|
<div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">org.bukkit.inventory</a></div>
|
|
<h1 title="Class ItemStack" class="title">Class ItemStack</h1>
|
|
</div>
|
|
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
|
|
<div class="inheritance">org.bukkit.inventory.ItemStack</div>
|
|
</div>
|
|
<section class="class-description" id="class-description">
|
|
<dl class="notes">
|
|
<dt>All Implemented Interfaces:</dt>
|
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Cloneable.html" title="class or interface in java.lang" class="external-link">Cloneable</a></code>, <code><a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEventSource.html" title="class or interface in net.kyori.adventure.text.event" class="external-link">HoverEventSource</a><<a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEvent.ShowItem.html" title="class or interface in net.kyori.adventure.text.event" class="external-link">HoverEvent.ShowItem</a>></code>, <code><a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/translation/Translatable.html" title="class or interface in net.kyori.adventure.translation" class="external-link">Translatable</a></code>, <code><a href="../configuration/serialization/ConfigurationSerializable.html" title="interface in org.bukkit.configuration.serialization">ConfigurationSerializable</a></code>, <code><a href="../Translatable.html" title="interface in org.bukkit">Translatable</a></code></dd>
|
|
</dl>
|
|
<hr>
|
|
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">ItemStack</span>
|
|
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
|
|
implements <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Cloneable.html" title="class or interface in java.lang" class="external-link">Cloneable</a>, <a href="../configuration/serialization/ConfigurationSerializable.html" title="interface in org.bukkit.configuration.serialization">ConfigurationSerializable</a>, <a href="../Translatable.html" title="interface in org.bukkit">Translatable</a>, <a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEventSource.html" title="class or interface in net.kyori.adventure.text.event" class="external-link">HoverEventSource</a><<a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEvent.ShowItem.html" title="class or interface in net.kyori.adventure.text.event" class="external-link">HoverEvent.ShowItem</a>>, <a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/translation/Translatable.html" title="class or interface in net.kyori.adventure.translation" class="external-link">Translatable</a></span></div>
|
|
<div class="block">Represents a stack of items.
|
|
<p>
|
|
<b>IMPORTANT: An <i>Item</i>Stack is only designed to contain <i>items</i>. Do not
|
|
use this class to encapsulate Materials for which <a href="../Material.html#isItem()"><code>Material.isItem()</code></a>
|
|
returns false.</b></div>
|
|
</section>
|
|
<section class="summary">
|
|
<ul class="summary-list">
|
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
|
<li>
|
|
<section class="constructor-summary" id="constructor-summary">
|
|
<h2>Constructor Summary</h2>
|
|
<div class="caption"><span>Constructors</span></div>
|
|
<div class="summary-table three-column-summary">
|
|
<div class="table-header col-first">Modifier</div>
|
|
<div class="table-header col-second">Constructor</div>
|
|
<div class="table-header col-last">Description</div>
|
|
<div class="col-first even-row-color"><code>protected </code></div>
|
|
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">ItemStack</a>()</code></div>
|
|
<div class="col-last even-row-color"> </div>
|
|
<div class="col-first odd-row-color"><code> </code></div>
|
|
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(org.bukkit.inventory.ItemStack)" class="member-name-link">ItemStack</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a> stack)</code></div>
|
|
<div class="col-last odd-row-color">
|
|
<div class="block">Creates a new item stack derived from the specified stack</div>
|
|
</div>
|
|
<div class="col-first even-row-color"><code> </code></div>
|
|
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(org.bukkit.Material)" class="member-name-link">ItemStack</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../Material.html" title="enum class in org.bukkit">Material</a> type)</code></div>
|
|
<div class="col-last even-row-color">
|
|
<div class="block">Defaults stack size to 1, with no extra data.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color"><code> </code></div>
|
|
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(org.bukkit.Material,int)" class="member-name-link">ItemStack</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../Material.html" title="enum class in org.bukkit">Material</a> type,
|
|
int amount)</code></div>
|
|
<div class="col-last odd-row-color">
|
|
<div class="block">An item stack with no extra data.</div>
|
|
</div>
|
|
<div class="col-first even-row-color"><code> </code></div>
|
|
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(org.bukkit.Material,int,short)" class="member-name-link">ItemStack</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../Material.html" title="enum class in org.bukkit">Material</a> type,
|
|
int amount,
|
|
short damage)</code></div>
|
|
<div class="col-last even-row-color">
|
|
<div class="block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">see <a href="#setDurability(short)"><code>setDurability(short)</code></a></div>
|
|
</div>
|
|
</div>
|
|
<div class="col-first odd-row-color"><code> </code></div>
|
|
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(org.bukkit.Material,int,short,java.lang.Byte)" class="member-name-link">ItemStack</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../Material.html" title="enum class in org.bukkit">Material</a> type,
|
|
int amount,
|
|
short damage,
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Byte.html" title="class or interface in java.lang" class="external-link">Byte</a> data)</code></div>
|
|
<div class="col-last odd-row-color">
|
|
<div class="block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">this method uses an ambiguous data byte object</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</li>
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
|
<li>
|
|
<section class="method-summary" id="method-summary">
|
|
<h2>Method Summary</h2>
|
|
<div id="method-summary-table">
|
|
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button><button id="method-summary-table-tab6" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab6', 3)" class="table-tab">Deprecated Methods</button></div>
|
|
<div id="method-summary-table.tabpanel" role="tabpanel">
|
|
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
|
|
<div class="table-header col-first">Modifier and Type</div>
|
|
<div class="table-header col-second">Method</div>
|
|
<div class="table-header col-last">Description</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#add()" class="member-name-link">add</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Adds 1 to this itemstack.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#add(int)" class="member-name-link">add</a><wbr>(int qty)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Adds quantity to this itemstack.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addEnchantment(org.bukkit.enchantments.Enchantment,int)" class="member-name-link">addEnchantment</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a> ench,
|
|
int level)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Adds the specified <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments"><code>Enchantment</code></a> to this item stack.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addEnchantments(java.util.Map)" class="member-name-link">addEnchantments</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>> enchantments)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Adds the specified enchantments to this item stack.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addItemFlags(org.bukkit.inventory.ItemFlag...)" class="member-name-link">addItemFlags</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemFlag.html" title="enum class in org.bukkit.inventory">ItemFlag</a>... itemFlags)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Set itemflags which should be ignored when rendering a ItemStack in the Client.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addUnsafeEnchantment(org.bukkit.enchantments.Enchantment,int)" class="member-name-link">addUnsafeEnchantment</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a> ench,
|
|
int level)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Adds the specified <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments"><code>Enchantment</code></a> to this item stack.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addUnsafeEnchantments(java.util.Map)" class="member-name-link">addUnsafeEnchantments</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>> enchantments)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Adds the specified enchantments to this item stack in an unsafe manner.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEvent.html" title="class or interface in net.kyori.adventure.text.event" class="external-link">HoverEvent</a><<a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEvent.ShowItem.html" title="class or interface in net.kyori.adventure.text.event" class="external-link">HoverEvent.ShowItem</a>></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#asHoverEvent(java.util.function.UnaryOperator)" class="member-name-link">asHoverEvent</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/function/UnaryOperator.html" title="class or interface in java.util.function" class="external-link">UnaryOperator</a><<a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEvent.ShowItem.html" title="class or interface in net.kyori.adventure.text.event" class="external-link">HoverEvent.ShowItem</a>> op)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Creates a hover event with value derived from this object.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#asOne()" class="member-name-link">asOne</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Clones the itemstack and returns it a single quantity.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#asQuantity(int)" class="member-name-link">asQuantity</a><wbr>(int qty)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Clones the itemstack and returns it as the specified quantity</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#canRepair(org.bukkit.inventory.ItemStack)" class="member-name-link">canRepair</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a> toBeRepaired)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Checks if this itemstack can repair another.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#clone()" class="member-name-link">clone</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#containsEnchantment(org.bukkit.enchantments.Enchantment)" class="member-name-link">containsEnchantment</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a> ench)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Checks if this ItemStack contains the given <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments"><code>Enchantment</code></a></div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#damage(int,org.bukkit.entity.LivingEntity)" class="member-name-link">damage</a><wbr>(int amount,
|
|
<a href="../entity/LivingEntity.html" title="interface in org.bukkit.entity">LivingEntity</a> livingEntity)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Damages this itemstack by the specified amount.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#deserialize(java.util.Map)" class="member-name-link">deserialize</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>> args)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
|
|
<div class="block">Required method for configuration serialization</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#deserializeBytes(byte%5B%5D)" class="member-name-link">deserializeBytes</a><wbr>(@org.jetbrains.annotations.NotNull byte[] bytes)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
|
|
<div class="block">Deserializes this itemstack from raw NBT bytes.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/Component.html" title="class or interface in net.kyori.adventure.text" class="external-link">Component</a></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#displayName()" class="member-name-link">displayName</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Get the formatted display name of the <a href="ItemStack.html" title="class in org.bukkit.inventory"><code>ItemStack</code></a>.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><M extends <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta">ItemMeta</a>><br>boolean</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#editMeta(java.lang.Class,java.util.function.Consumer)" class="member-name-link">editMeta</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><M> metaClass,
|
|
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/function/Consumer.html" title="class or interface in java.util.function" class="external-link">Consumer</a><<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> ? super M> consumer)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Edits the <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta"><code>ItemMeta</code></a> of this stack if the meta is of the specified type.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#editMeta(java.util.function.Consumer)" class="member-name-link">editMeta</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/function/Consumer.html" title="class or interface in java.util.function" class="external-link">Consumer</a><? super <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta">ItemMeta</a>> consumer)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Edits the <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta"><code>ItemMeta</code></a> of this stack.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#enchantWithLevels(int,boolean,java.util.Random)" class="member-name-link">enchantWithLevels</a><wbr>(@org.jetbrains.annotations.Range(from=1L, to=30L) int levels,
|
|
boolean allowTreasure,
|
|
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Random.html" title="class or interface in java.util" class="external-link">Random</a> random)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Randomly enchants a copy of this <a href="ItemStack.html" title="class in org.bukkit.inventory"><code>ItemStack</code></a> using the given experience levels.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#ensureServerConversions()" class="member-name-link">ensureServerConversions</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Minecraft updates are converting simple item stacks into more complex NBT oriented Item Stacks.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#equals(java.lang.Object)" class="member-name-link">equals</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> obj)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getAmount()" class="member-name-link">getAmount</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Gets the amount of items in this stack</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="../material/MaterialData.html" title="class in org.bukkit.material">MaterialData</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code><a href="#getData()" class="member-name-link">getData</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6">
|
|
<div class="block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">cast to <a href="meta/BlockDataMeta.html" title="interface in org.bukkit.inventory.meta"><code>BlockDataMeta</code></a> and use <a href="meta/BlockDataMeta.html#getBlockData(org.bukkit.Material)"><code>BlockDataMeta.getBlockData(Material)</code></a></div>
|
|
</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code>short</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code><a href="#getDurability()" class="member-name-link">getDurability</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6">
|
|
<div class="block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">see <a href="#setDurability(short)"><code>setDurability(short)</code></a></div>
|
|
</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getEnchantmentLevel(org.bukkit.enchantments.Enchantment)" class="member-name-link">getEnchantmentLevel</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a> ench)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Gets the level of the specified enchantment on this item stack</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getEnchantments()" class="member-name-link">getEnchantments</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Gets a map containing all enchantments and their levels on this item.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code><a href="#getI18NDisplayName()" class="member-name-link">getI18NDisplayName</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6">
|
|
<div class="block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment"><a href="ItemStack.html" title="class in org.bukkit.inventory"><code>ItemStack</code></a> implements <a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/translation/Translatable.html" title="class or interface in net.kyori.adventure.translation" class="external-link"><code>Translatable</code></a>; use that and
|
|
<a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/Component.html#translatable(net.kyori.adventure.translation.Translatable)" title="class or interface in net.kyori.adventure.text" class="external-link"><code>Component.translatable(net.kyori.adventure.translation.Translatable)</code></a> instead.</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a><<a href="ItemFlag.html" title="enum class in org.bukkit.inventory">ItemFlag</a>></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getItemFlags()" class="member-name-link">getItemFlags</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Get current set itemFlags.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta">ItemMeta</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getItemMeta()" class="member-name-link">getItemMeta</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Get a copy of this ItemStack's <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta"><code>ItemMeta</code></a>.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code><a href="#getLore()" class="member-name-link">getLore</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6">
|
|
<div class="block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">in favor of <a href="#lore()"><code>lore()</code></a></div>
|
|
</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getMaxItemUseDuration()" class="member-name-link">getMaxItemUseDuration</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getMaxStackSize()" class="member-name-link">getMaxStackSize</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Get the maximum stacksize for the material hold in this ItemStack.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../../../io/papermc/paper/inventory/ItemRarity.html" title="enum class in io.papermc.paper.inventory">ItemRarity</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getRarity()" class="member-name-link">getRarity</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Gets the item rarity of the itemstack.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code><a href="#getTranslationKey()" class="member-name-link">getTranslationKey</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6">
|
|
<div class="block"><span class="deprecated-label">Deprecated, for removal: This API element is subject to removal in a future version.</span></div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../Material.html" title="enum class in org.bukkit">Material</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getType()" class="member-name-link">getType</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Gets the type of this item</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#hashCode()" class="member-name-link">hashCode</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#hasItemFlag(org.bukkit.inventory.ItemFlag)" class="member-name-link">hasItemFlag</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemFlag.html" title="enum class in org.bukkit.inventory">ItemFlag</a> flag)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Check if the specified flag is present on this item.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#hasItemMeta()" class="member-name-link">hasItemMeta</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Checks to see if any meta data has been defined.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isRepairableBy(org.bukkit.inventory.ItemStack)" class="member-name-link">isRepairableBy</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a> repairMaterial)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Checks if an itemstack can repair this itemstack.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isSimilar(org.bukkit.inventory.ItemStack)" class="member-name-link">isSimilar</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a> stack)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">This method is the same as equals, but does not consider stack size
|
|
(amount).</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/Component.html" title="class or interface in net.kyori.adventure.text" class="external-link">Component</a>></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#lore()" class="member-name-link">lore</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">If the item has lore, returns it, else it will return null</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#lore(java.util.List)" class="member-name-link">lore</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><? extends <a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/Component.html" title="class or interface in net.kyori.adventure.text" class="external-link">Component</a>> lore)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Sets the lore for this item.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#removeEnchantment(org.bukkit.enchantments.Enchantment)" class="member-name-link">removeEnchantment</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a> ench)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Removes the specified <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments"><code>Enchantment</code></a> if it exists on this
|
|
ItemStack</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#removeItemFlags(org.bukkit.inventory.ItemFlag...)" class="member-name-link">removeItemFlags</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemFlag.html" title="enum class in org.bukkit.inventory">ItemFlag</a>... itemFlags)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Remove specific set of itemFlags.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#serialize()" class="member-name-link">serialize</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Creates a Map representation of this class.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>@org.jetbrains.annotations.NotNull byte[]</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#serializeAsBytes()" class="member-name-link">serializeAsBytes</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Serializes this itemstack to raw bytes in NBT.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setAmount(int)" class="member-name-link">setAmount</a><wbr>(int amount)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Sets the amount of items in this stack</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code>void</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code><a href="#setData(org.bukkit.material.MaterialData)" class="member-name-link">setData</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="../material/MaterialData.html" title="class in org.bukkit.material">MaterialData</a> data)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6">
|
|
<div class="block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">cast to <a href="meta/BlockDataMeta.html" title="interface in org.bukkit.inventory.meta"><code>BlockDataMeta</code></a> and use <a href="meta/BlockDataMeta.html#setBlockData(org.bukkit.block.data.BlockData)"><code>BlockDataMeta.setBlockData(org.bukkit.block.data.BlockData)</code></a></div>
|
|
</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code>void</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code><a href="#setDurability(short)" class="member-name-link">setDurability</a><wbr>(short durability)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6">
|
|
<div class="block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">durability is now part of ItemMeta.</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setItemMeta(org.bukkit.inventory.meta.ItemMeta)" class="member-name-link">setItemMeta</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta">ItemMeta</a> itemMeta)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Set the ItemMeta of this ItemStack.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code>void</code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6"><code><a href="#setLore(java.util.List)" class="member-name-link">setLore</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>> lore)</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4 method-summary-table-tab6">
|
|
<div class="block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">in favour of <a href="#lore(java.util.List)"><code>lore(List)</code></a></div>
|
|
</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setType(org.bukkit.Material)" class="member-name-link">setType</a><wbr>(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../Material.html" title="enum class in org.bukkit">Material</a> type)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Sets the type of this item</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#subtract()" class="member-name-link">subtract</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Subtracts 1 to this itemstack.</div>
|
|
</div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#subtract(int)" class="member-name-link">subtract</a><wbr>(int qty)</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Subtracts quantity to this itemstack.</div>
|
|
</div>
|
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
|
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString()" class="member-name-link">toString</a>()</code></div>
|
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
|
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#translationKey()" class="member-name-link">translationKey</a>()</code></div>
|
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
|
|
<div class="block">Gets the translation key.</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="inherited-list">
|
|
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
|
|
<code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
|
|
<div class="inherited-list">
|
|
<h3 id="methods-inherited-from-class-net.kyori.adventure.text.event.HoverEventSource">Methods inherited from interface net.kyori.adventure.text.event.<a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEventSource.html" title="class or interface in net.kyori.adventure.text.event" class="external-link">HoverEventSource</a></h3>
|
|
<code><a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEventSource.html#asHoverEvent()" title="class or interface in net.kyori.adventure.text.event" class="external-link">asHoverEvent</a></code></div>
|
|
</section>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="details">
|
|
<ul class="details-list">
|
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
|
<li>
|
|
<section class="constructor-details" id="constructor-detail">
|
|
<h2>Constructor Details</h2>
|
|
<ul class="member-list">
|
|
<li>
|
|
<section class="detail" id="<init>()">
|
|
<h3>ItemStack</h3>
|
|
<div class="member-signature"><span class="modifiers">protected</span> <span class="element-name">ItemStack</span>()</div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="<init>(org.bukkit.Material)">
|
|
<h3>ItemStack</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="element-name">ItemStack</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../Material.html" title="enum class in org.bukkit">Material</a> type)</span></div>
|
|
<div class="block">Defaults stack size to 1, with no extra data.
|
|
<p>
|
|
<b>IMPORTANT: An <i>Item</i>Stack is only designed to contain
|
|
<i>items</i>. Do not use this class to encapsulate Materials for which
|
|
<a href="../Material.html#isItem()"><code>Material.isItem()</code></a> returns false.</b></div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>type</code> - item material</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="<init>(org.bukkit.Material,int)">
|
|
<h3>ItemStack</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="element-name">ItemStack</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../Material.html" title="enum class in org.bukkit">Material</a> type,
|
|
int amount)</span></div>
|
|
<div class="block">An item stack with no extra data.
|
|
<p>
|
|
<b>IMPORTANT: An <i>Item</i>Stack is only designed to contain
|
|
<i>items</i>. Do not use this class to encapsulate Materials for which
|
|
<a href="../Material.html#isItem()"><code>Material.isItem()</code></a> returns false.</b></div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>type</code> - item material</dd>
|
|
<dd><code>amount</code> - stack size</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="<init>(org.bukkit.Material,int,short)">
|
|
<h3>ItemStack</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a>
|
|
</span><span class="modifiers">public</span> <span class="element-name">ItemStack</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../Material.html" title="enum class in org.bukkit">Material</a> type,
|
|
int amount,
|
|
short damage)</span></div>
|
|
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">see <a href="#setDurability(short)"><code>setDurability(short)</code></a></div>
|
|
</div>
|
|
<div class="block">An item stack with the specified damage / durability</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>type</code> - item material</dd>
|
|
<dd><code>amount</code> - stack size</dd>
|
|
<dd><code>damage</code> - durability / damage</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="<init>(org.bukkit.Material,int,short,java.lang.Byte)">
|
|
<h3>ItemStack</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a>
|
|
</span><span class="modifiers">public</span> <span class="element-name">ItemStack</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../Material.html" title="enum class in org.bukkit">Material</a> type,
|
|
int amount,
|
|
short damage,
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Byte.html" title="class or interface in java.lang" class="external-link">Byte</a> data)</span></div>
|
|
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">this method uses an ambiguous data byte object</div>
|
|
</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>type</code> - the type</dd>
|
|
<dd><code>amount</code> - the amount in the stack</dd>
|
|
<dd><code>damage</code> - the damage value of the item</dd>
|
|
<dd><code>data</code> - the data value or null</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="<init>(org.bukkit.inventory.ItemStack)">
|
|
<h3>ItemStack</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="element-name">ItemStack</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a> stack)</span>
|
|
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></span></div>
|
|
<div class="block">Creates a new item stack derived from the specified stack</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>stack</code> - the stack to copy</dd>
|
|
<dt>Throws:</dt>
|
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if the specified stack is null or
|
|
returns an item meta not created by the item factory</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</li>
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
<li>
|
|
<section class="method-details" id="method-detail">
|
|
<h2>Method Details</h2>
|
|
<ul class="member-list">
|
|
<li>
|
|
<section class="detail" id="getType()">
|
|
<h3>getType</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../Material.html" title="enum class in org.bukkit">Material</a></span> <span class="element-name">getType</span>()</div>
|
|
<div class="block">Gets the type of this item</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>Type of the items in this stack</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setType(org.bukkit.Material)">
|
|
<h3>setType</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setType</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../Material.html" title="enum class in org.bukkit">Material</a> type)</span></div>
|
|
<div class="block">Sets the type of this item
|
|
<p>
|
|
Note that in doing so you will reset the MaterialData for this stack.
|
|
<p>
|
|
<b>IMPORTANT: An <i>Item</i>Stack is only designed to contain
|
|
<i>items</i>. Do not use this class to encapsulate Materials for which
|
|
<a href="../Material.html#isItem()"><code>Material.isItem()</code></a> returns false.</b></div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>type</code> - New type to set the items in this stack to</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getAmount()">
|
|
<h3>getAmount</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">getAmount</span>()</div>
|
|
<div class="block">Gets the amount of items in this stack</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>Amount of items in this stack</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setAmount(int)">
|
|
<h3>setAmount</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setAmount</span><wbr><span class="parameters">(int amount)</span></div>
|
|
<div class="block">Sets the amount of items in this stack</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>amount</code> - New amount of items in this stack</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getData()">
|
|
<h3>getData</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a>
|
|
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="../material/MaterialData.html" title="class in org.bukkit.material">MaterialData</a></span> <span class="element-name">getData</span>()</div>
|
|
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">cast to <a href="meta/BlockDataMeta.html" title="interface in org.bukkit.inventory.meta"><code>BlockDataMeta</code></a> and use <a href="meta/BlockDataMeta.html#getBlockData(org.bukkit.Material)"><code>BlockDataMeta.getBlockData(Material)</code></a></div>
|
|
</div>
|
|
<div class="block">Gets the MaterialData for this stack of items</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>MaterialData for this item</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setData(org.bukkit.material.MaterialData)">
|
|
<h3>setData</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setData</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="../material/MaterialData.html" title="class in org.bukkit.material">MaterialData</a> data)</span></div>
|
|
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">cast to <a href="meta/BlockDataMeta.html" title="interface in org.bukkit.inventory.meta"><code>BlockDataMeta</code></a> and use <a href="meta/BlockDataMeta.html#setBlockData(org.bukkit.block.data.BlockData)"><code>BlockDataMeta.setBlockData(org.bukkit.block.data.BlockData)</code></a></div>
|
|
</div>
|
|
<div class="block">Sets the MaterialData for this stack of items</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>data</code> - New MaterialData for this item</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setDurability(short)">
|
|
<h3>setDurability</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setDurability</span><wbr><span class="parameters">(short durability)</span></div>
|
|
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">durability is now part of ItemMeta. To avoid confusion and
|
|
misuse, <a href="#getItemMeta()"><code>getItemMeta()</code></a>, <a href="#setItemMeta(org.bukkit.inventory.meta.ItemMeta)"><code>setItemMeta(ItemMeta)</code></a> and
|
|
<a href="meta/Damageable.html#setDamage(int)"><code>Damageable.setDamage(int)</code></a> should be used instead. This is because
|
|
any call to this method will be overwritten by subsequent setting of
|
|
ItemMeta which was created before this call.</div>
|
|
</div>
|
|
<div class="block">Sets the durability of this item</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>durability</code> - Durability of this item</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getDurability()">
|
|
<h3>getDurability</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type">short</span> <span class="element-name">getDurability</span>()</div>
|
|
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">see <a href="#setDurability(short)"><code>setDurability(short)</code></a></div>
|
|
</div>
|
|
<div class="block">Gets the durability of this item</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>Durability of this item</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getMaxStackSize()">
|
|
<h3>getMaxStackSize</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">getMaxStackSize</span>()</div>
|
|
<div class="block">Get the maximum stacksize for the material hold in this ItemStack.
|
|
(Returns -1 if it has no idea)</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>The maximum you can stack this material to.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="toString()">
|
|
<h3>toString</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">toString</span>()</div>
|
|
<dl class="notes">
|
|
<dt>Overrides:</dt>
|
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="equals(java.lang.Object)">
|
|
<h3>equals</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">equals</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> obj)</span></div>
|
|
<dl class="notes">
|
|
<dt>Overrides:</dt>
|
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="isSimilar(org.bukkit.inventory.ItemStack)">
|
|
<h3>isSimilar</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">isSimilar</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a> stack)</span></div>
|
|
<div class="block">This method is the same as equals, but does not consider stack size
|
|
(amount).</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>stack</code> - the item stack to compare to</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>true if the two stacks are equal, ignoring the amount</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="clone()">
|
|
<h3>clone</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></span> <span class="element-name">clone</span>()</div>
|
|
<dl class="notes">
|
|
<dt>Overrides:</dt>
|
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="hashCode()">
|
|
<h3>hashCode</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">hashCode</span>()</div>
|
|
<dl class="notes">
|
|
<dt>Overrides:</dt>
|
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="containsEnchantment(org.bukkit.enchantments.Enchantment)">
|
|
<h3>containsEnchantment</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">containsEnchantment</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a> ench)</span></div>
|
|
<div class="block">Checks if this ItemStack contains the given <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments"><code>Enchantment</code></a></div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>ench</code> - Enchantment to test</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>True if this has the given enchantment</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getEnchantmentLevel(org.bukkit.enchantments.Enchantment)">
|
|
<h3>getEnchantmentLevel</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">getEnchantmentLevel</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a> ench)</span></div>
|
|
<div class="block">Gets the level of the specified enchantment on this item stack</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>ench</code> - Enchantment to check</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>Level of the enchantment, or 0</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getEnchantments()">
|
|
<h3>getEnchantments</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>></span> <span class="element-name">getEnchantments</span>()</div>
|
|
<div class="block">Gets a map containing all enchantments and their levels on this item.</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>Map of enchantments.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="addEnchantments(java.util.Map)">
|
|
<h3>addEnchantments</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">addEnchantments</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>> enchantments)</span></div>
|
|
<div class="block">Adds the specified enchantments to this item stack.
|
|
<p>
|
|
This method is the same as calling <a href="#addEnchantment(org.bukkit.enchantments.Enchantment,int)"><code>addEnchantment(org.bukkit.enchantments.Enchantment, int)</code></a> for each
|
|
element of the map.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>enchantments</code> - Enchantments to add</dd>
|
|
<dt>Throws:</dt>
|
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if the specified enchantments is null</dd>
|
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if any specific enchantment or level
|
|
is null. <b>Warning</b>: Some enchantments may be added before this
|
|
exception is thrown.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="addEnchantment(org.bukkit.enchantments.Enchantment,int)">
|
|
<h3>addEnchantment</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">addEnchantment</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a> ench,
|
|
int level)</span></div>
|
|
<div class="block">Adds the specified <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments"><code>Enchantment</code></a> to this item stack.
|
|
<p>
|
|
If this item stack already contained the given enchantment (at any
|
|
level), it will be replaced.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>ench</code> - Enchantment to add</dd>
|
|
<dd><code>level</code> - Level of the enchantment</dd>
|
|
<dt>Throws:</dt>
|
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if enchantment null, or enchantment is
|
|
not applicable</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="addUnsafeEnchantments(java.util.Map)">
|
|
<h3>addUnsafeEnchantments</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">addUnsafeEnchantments</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>> enchantments)</span></div>
|
|
<div class="block">Adds the specified enchantments to this item stack in an unsafe manner.
|
|
<p>
|
|
This method is the same as calling <a href="#addUnsafeEnchantment(org.bukkit.enchantments.Enchantment,int)"><code>addUnsafeEnchantment(org.bukkit.enchantments.Enchantment, int)</code></a> for
|
|
each element of the map.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>enchantments</code> - Enchantments to add</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="addUnsafeEnchantment(org.bukkit.enchantments.Enchantment,int)">
|
|
<h3>addUnsafeEnchantment</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">addUnsafeEnchantment</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a> ench,
|
|
int level)</span></div>
|
|
<div class="block">Adds the specified <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments"><code>Enchantment</code></a> to this item stack.
|
|
<p>
|
|
If this item stack already contained the given enchantment (at any
|
|
level), it will be replaced.
|
|
<p>
|
|
This method is unsafe and will ignore level restrictions or item type.
|
|
Use at your own discretion.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>ench</code> - Enchantment to add</dd>
|
|
<dd><code>level</code> - Level of the enchantment</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="removeEnchantment(org.bukkit.enchantments.Enchantment)">
|
|
<h3>removeEnchantment</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">removeEnchantment</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments">Enchantment</a> ench)</span></div>
|
|
<div class="block">Removes the specified <a href="../enchantments/Enchantment.html" title="class in org.bukkit.enchantments"><code>Enchantment</code></a> if it exists on this
|
|
ItemStack</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>ench</code> - Enchantment to remove</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>Previous level, or 0</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="serialize()">
|
|
<h3>serialize</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>></span> <span class="element-name">serialize</span>()</div>
|
|
<div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../configuration/serialization/ConfigurationSerializable.html#serialize()">ConfigurationSerializable</a></code></span></div>
|
|
<div class="block">Creates a Map representation of this class.
|
|
<p>
|
|
This class must provide a method to restore this class, as defined in
|
|
the <a href="../configuration/serialization/ConfigurationSerializable.html" title="interface in org.bukkit.configuration.serialization"><code>ConfigurationSerializable</code></a> interface javadocs.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="../configuration/serialization/ConfigurationSerializable.html#serialize()">serialize</a></code> in interface <code><a href="../configuration/serialization/ConfigurationSerializable.html" title="interface in org.bukkit.configuration.serialization">ConfigurationSerializable</a></code></dd>
|
|
<dt>Returns:</dt>
|
|
<dd>Map containing the current state of this class</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="deserialize(java.util.Map)">
|
|
<h3>deserialize</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public static</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></span> <span class="element-name">deserialize</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>> args)</span></div>
|
|
<div class="block">Required method for configuration serialization</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>args</code> - map to deserialize</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>deserialized item stack</dd>
|
|
<dt>See Also:</dt>
|
|
<dd>
|
|
<ul class="see-list">
|
|
<li><a href="../configuration/serialization/ConfigurationSerializable.html" title="interface in org.bukkit.configuration.serialization"><code>ConfigurationSerializable</code></a></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="editMeta(java.util.function.Consumer)">
|
|
<h3>editMeta</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">editMeta</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/function/Consumer.html" title="class or interface in java.util.function" class="external-link">Consumer</a><? super <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta">ItemMeta</a>> consumer)</span></div>
|
|
<div class="block">Edits the <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta"><code>ItemMeta</code></a> of this stack.
|
|
<p>
|
|
The <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/function/Consumer.html" title="class or interface in java.util.function" class="external-link"><code>Consumer</code></a> must only interact
|
|
with this stack's <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta"><code>ItemMeta</code></a> through the provided <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta"><code>ItemMeta</code></a> instance.
|
|
Calling this method or any other meta-related method of the <a href="ItemStack.html" title="class in org.bukkit.inventory"><code>ItemStack</code></a> class
|
|
(such as <a href="#getItemMeta()"><code>getItemMeta()</code></a>, <a href="#addItemFlags(org.bukkit.inventory.ItemFlag...)"><code>addItemFlags(ItemFlag...)</code></a>, <a href="#lore()"><code>lore()</code></a>, etc.)
|
|
from inside the consumer is disallowed and will produce undefined results or exceptions.
|
|
</p></div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>consumer</code> - the meta consumer</dd>
|
|
<dt>Returns:</dt>
|
|
<dd><code>true</code> if the edit was successful, <code>false</code> otherwise</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="editMeta(java.lang.Class,java.util.function.Consumer)">
|
|
<h3>editMeta</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="type-parameters"><M extends <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta">ItemMeta</a>></span> <span class="return-type">boolean</span> <span class="element-name">editMeta</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a><M> metaClass,
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/function/Consumer.html" title="class or interface in java.util.function" class="external-link">Consumer</a><<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> ? super M> consumer)</span></div>
|
|
<div class="block">Edits the <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta"><code>ItemMeta</code></a> of this stack if the meta is of the specified type.
|
|
<p>
|
|
The <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/function/Consumer.html" title="class or interface in java.util.function" class="external-link"><code>Consumer</code></a> must only interact
|
|
with this stack's <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta"><code>ItemMeta</code></a> through the provided <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta"><code>ItemMeta</code></a> instance.
|
|
Calling this method or any other meta-related method of the <a href="ItemStack.html" title="class in org.bukkit.inventory"><code>ItemStack</code></a> class
|
|
(such as <a href="#getItemMeta()"><code>getItemMeta()</code></a>, <a href="#addItemFlags(org.bukkit.inventory.ItemFlag...)"><code>addItemFlags(ItemFlag...)</code></a>, <a href="#lore()"><code>lore()</code></a>, etc.)
|
|
from inside the consumer is disallowed and will produce undefined results or exceptions.
|
|
</p></div>
|
|
<dl class="notes">
|
|
<dt>Type Parameters:</dt>
|
|
<dd><code>M</code> - the meta type</dd>
|
|
<dt>Parameters:</dt>
|
|
<dd><code>metaClass</code> - the type of meta to edit</dd>
|
|
<dd><code>consumer</code> - the meta consumer</dd>
|
|
<dt>Returns:</dt>
|
|
<dd><code>true</code> if the edit was successful, <code>false</code> otherwise</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getItemMeta()">
|
|
<h3>getItemMeta</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="../UndefinedNullability.html" title="annotation interface in org.bukkit">@UndefinedNullability</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta">ItemMeta</a></span> <span class="element-name">getItemMeta</span>()</div>
|
|
<div class="block">Get a copy of this ItemStack's <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta"><code>ItemMeta</code></a>.</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>a copy of the current ItemStack's ItemData</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="hasItemMeta()">
|
|
<h3>hasItemMeta</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">hasItemMeta</span>()</div>
|
|
<div class="block">Checks to see if any meta data has been defined.</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>Returns true if some meta data has been set for this item</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setItemMeta(org.bukkit.inventory.meta.ItemMeta)">
|
|
<h3>setItemMeta</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">setItemMeta</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="meta/ItemMeta.html" title="interface in org.bukkit.inventory.meta">ItemMeta</a> itemMeta)</span></div>
|
|
<div class="block">Set the ItemMeta of this ItemStack.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>itemMeta</code> - new ItemMeta, or null to indicate meta data be cleared.</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>True if successfully applied ItemMeta, see <a href="ItemFactory.html#isApplicable(org.bukkit.inventory.meta.ItemMeta,org.bukkit.inventory.ItemStack)"><code>ItemFactory.isApplicable(ItemMeta, ItemStack)</code></a></dd>
|
|
<dt>Throws:</dt>
|
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if the item meta was not created by
|
|
the <a href="ItemFactory.html" title="interface in org.bukkit.inventory"><code>ItemFactory</code></a></dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getTranslationKey()">
|
|
<h3>getTranslationKey</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Deprecated.html#forRemoval()" title="class or interface in java.lang" class="external-link">forRemoval</a>=true)
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getTranslationKey</span>()</div>
|
|
<div class="deprecation-block"><span class="deprecated-label">Deprecated, for removal: This API element is subject to removal in a future version.</span></div>
|
|
<div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="../Translatable.html#getTranslationKey()">Translatable</a></code></span></div>
|
|
<div class="block">Get the translation key, suitable for use in a translation component.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="../Translatable.html#getTranslationKey()">getTranslationKey</a></code> in interface <code><a href="../Translatable.html" title="interface in org.bukkit">Translatable</a></code></dd>
|
|
<dt>Returns:</dt>
|
|
<dd>the translation key</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="enchantWithLevels(int,boolean,java.util.Random)">
|
|
<h3>enchantWithLevels</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></span> <span class="element-name">enchantWithLevels</span><wbr><span class="parameters">(@org.jetbrains.annotations.Range(from=1L, to=30L) int levels,
|
|
boolean allowTreasure,
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Random.html" title="class or interface in java.util" class="external-link">Random</a> random)</span></div>
|
|
<div class="block">Randomly enchants a copy of this <a href="ItemStack.html" title="class in org.bukkit.inventory"><code>ItemStack</code></a> using the given experience levels.
|
|
|
|
<p>If this ItemStack is already enchanted, the existing enchants will be removed before enchanting.</p>
|
|
|
|
<p>Levels must be in range <code>[1, 30]</code>.</p></div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>levels</code> - levels to use for enchanting</dd>
|
|
<dd><code>allowTreasure</code> - whether to allow enchantments where <a href="../enchantments/Enchantment.html#isTreasure()"><code>Enchantment.isTreasure()</code></a> returns true</dd>
|
|
<dd><code>random</code> - <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Random.html" title="class or interface in java.util" class="external-link"><code>Random</code></a> instance to use for enchanting</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>enchanted copy of the provided ItemStack</dd>
|
|
<dt>Throws:</dt>
|
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - on bad arguments</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="asHoverEvent(java.util.function.UnaryOperator)">
|
|
<h3>asHoverEvent</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEvent.html" title="class or interface in net.kyori.adventure.text.event" class="external-link">HoverEvent</a><<a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEvent.ShowItem.html" title="class or interface in net.kyori.adventure.text.event" class="external-link">HoverEvent.ShowItem</a>></span> <span class="element-name">asHoverEvent</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/function/UnaryOperator.html" title="class or interface in java.util.function" class="external-link">UnaryOperator</a><<a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEvent.ShowItem.html" title="class or interface in net.kyori.adventure.text.event" class="external-link">HoverEvent.ShowItem</a>> op)</span></div>
|
|
<div class="block"><span class="descfrm-type-label">Description copied from interface: <code><a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEventSource.html#asHoverEvent(java.util.function.UnaryOperator)" title="class or interface in net.kyori.adventure.text.event" class="external-link">net.kyori.adventure.text.event.HoverEventSource</a></code></span></div>
|
|
<div class="block">Creates a hover event with value derived from this object.
|
|
|
|
<p>The event value will be passed through the provided callback to allow
|
|
transforming the original value of the event.</p></div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEventSource.html#asHoverEvent(java.util.function.UnaryOperator)" title="class or interface in net.kyori.adventure.text.event" class="external-link">asHoverEvent</a></code> in interface <code><a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEventSource.html" title="class or interface in net.kyori.adventure.text.event" class="external-link">HoverEventSource</a><<a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/event/HoverEvent.ShowItem.html" title="class or interface in net.kyori.adventure.text.event" class="external-link">HoverEvent.ShowItem</a>></code></dd>
|
|
<dt>Parameters:</dt>
|
|
<dd><code>op</code> - transformation on value</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>a hover event</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="displayName()">
|
|
<h3>displayName</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/Component.html" title="class or interface in net.kyori.adventure.text" class="external-link">Component</a></span> <span class="element-name">displayName</span>()</div>
|
|
<div class="block">Get the formatted display name of the <a href="ItemStack.html" title="class in org.bukkit.inventory"><code>ItemStack</code></a>.</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>display name of the <a href="ItemStack.html" title="class in org.bukkit.inventory"><code>ItemStack</code></a></dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="ensureServerConversions()">
|
|
<h3>ensureServerConversions</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></span> <span class="element-name">ensureServerConversions</span>()</div>
|
|
<div class="block">Minecraft updates are converting simple item stacks into more complex NBT oriented Item Stacks.
|
|
|
|
Use this method to ensure any desired data conversions are processed.
|
|
The input itemstack will not be the same as the returned itemstack.</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>A potentially Data Converted ItemStack</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="deserializeBytes(byte[])">
|
|
<h3>deserializeBytes</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public static</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></span> <span class="element-name">deserializeBytes</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
@org.jetbrains.annotations.NotNull byte[] bytes)</span></div>
|
|
<div class="block">Deserializes this itemstack from raw NBT bytes. NBT is safer for data migrations as it will
|
|
use the built in data converter instead of bukkits dangerous serialization system.
|
|
|
|
This expects that the DataVersion was stored on the root of the Compound, as saved from
|
|
the <a href="#serializeAsBytes()"><code>serializeAsBytes()</code></a> API returned.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>bytes</code> - bytes representing an item in NBT</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>ItemStack migrated to this version of Minecraft if needed.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="serializeAsBytes()">
|
|
<h3>serializeAsBytes</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type">@org.jetbrains.annotations.NotNull byte[]</span> <span class="element-name">serializeAsBytes</span>()</div>
|
|
<div class="block">Serializes this itemstack to raw bytes in NBT. NBT is safer for data migrations as it will
|
|
use the built in data converter instead of bukkits dangerous serialization system.</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>bytes representing this item in NBT.</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getI18NDisplayName()">
|
|
<h3>getI18NDisplayName</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a>
|
|
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getI18NDisplayName</span>()</div>
|
|
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment"><a href="ItemStack.html" title="class in org.bukkit.inventory"><code>ItemStack</code></a> implements <a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/translation/Translatable.html" title="class or interface in net.kyori.adventure.translation" class="external-link"><code>Translatable</code></a>; use that and
|
|
<a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/Component.html#translatable(net.kyori.adventure.translation.Translatable)" title="class or interface in net.kyori.adventure.text" class="external-link"><code>Component.translatable(net.kyori.adventure.translation.Translatable)</code></a> instead.</div>
|
|
</div>
|
|
<div class="block">Gets the Display name as seen in the Client.
|
|
Currently the server only supports the English language. To override this,
|
|
You must replace the language file embedded in the server jar.</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>Display name of Item</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getMaxItemUseDuration()">
|
|
<h3>getMaxItemUseDuration</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">getMaxItemUseDuration</span>()</div>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="asOne()">
|
|
<h3>asOne</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></span> <span class="element-name">asOne</span>()</div>
|
|
<div class="block">Clones the itemstack and returns it a single quantity.</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>The new itemstack with 1 quantity</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="asQuantity(int)">
|
|
<h3>asQuantity</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></span> <span class="element-name">asQuantity</span><wbr><span class="parameters">(int qty)</span></div>
|
|
<div class="block">Clones the itemstack and returns it as the specified quantity</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>qty</code> - The quantity of the cloned item</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>The new itemstack with specified quantity</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="add()">
|
|
<h3>add</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></span> <span class="element-name">add</span>()</div>
|
|
<div class="block">Adds 1 to this itemstack. Will not go over the items max stack size.</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>The same item (not a clone)</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="add(int)">
|
|
<h3>add</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></span> <span class="element-name">add</span><wbr><span class="parameters">(int qty)</span></div>
|
|
<div class="block">Adds quantity to this itemstack. Will not go over the items max stack size.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>qty</code> - The amount to add</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>The same item (not a clone)</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="subtract()">
|
|
<h3>subtract</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></span> <span class="element-name">subtract</span>()</div>
|
|
<div class="block">Subtracts 1 to this itemstack. Going to 0 or less will invalidate the item.</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>The same item (not a clone)</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="subtract(int)">
|
|
<h3>subtract</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></span> <span class="element-name">subtract</span><wbr><span class="parameters">(int qty)</span></div>
|
|
<div class="block">Subtracts quantity to this itemstack. Going to 0 or less will invalidate the item.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>qty</code> - The amount to add</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>The same item (not a clone)</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getLore()">
|
|
<h3>getLore</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>></span> <span class="element-name">getLore</span>()</div>
|
|
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">in favor of <a href="#lore()"><code>lore()</code></a></div>
|
|
</div>
|
|
<div class="block">If the item has lore, returns it, else it will return null</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>The lore, or null</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="lore()">
|
|
<h3>lore</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/Component.html" title="class or interface in net.kyori.adventure.text" class="external-link">Component</a>></span> <span class="element-name">lore</span>()</div>
|
|
<div class="block">If the item has lore, returns it, else it will return null</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>The lore, or null</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="setLore(java.util.List)">
|
|
<h3>setLore</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setLore</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>> lore)</span></div>
|
|
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span>
|
|
<div class="deprecation-comment">in favour of <a href="#lore(java.util.List)"><code>lore(List)</code></a></div>
|
|
</div>
|
|
<div class="block">Sets the lore for this item.
|
|
Removes lore when given null.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>lore</code> - the lore that will be set</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="lore(java.util.List)">
|
|
<h3>lore</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">lore</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/Nullable.html" title="class or interface in org.jetbrains.annotations" class="external-link">@Nullable</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><? extends <a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/text/Component.html" title="class or interface in net.kyori.adventure.text" class="external-link">Component</a>> lore)</span></div>
|
|
<div class="block">Sets the lore for this item.
|
|
Removes lore when given null.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>lore</code> - the lore that will be set</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="addItemFlags(org.bukkit.inventory.ItemFlag...)">
|
|
<h3>addItemFlags</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">addItemFlags</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemFlag.html" title="enum class in org.bukkit.inventory">ItemFlag</a>... itemFlags)</span></div>
|
|
<div class="block">Set itemflags which should be ignored when rendering a ItemStack in the Client. This Method does silently ignore double set itemFlags.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>itemFlags</code> - The hideflags which shouldn't be rendered</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="removeItemFlags(org.bukkit.inventory.ItemFlag...)">
|
|
<h3>removeItemFlags</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">removeItemFlags</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemFlag.html" title="enum class in org.bukkit.inventory">ItemFlag</a>... itemFlags)</span></div>
|
|
<div class="block">Remove specific set of itemFlags. This tells the Client it should render it again. This Method does silently ignore double removed itemFlags.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>itemFlags</code> - Hideflags which should be removed</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getItemFlags()">
|
|
<h3>getItemFlags</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a><<a href="ItemFlag.html" title="enum class in org.bukkit.inventory">ItemFlag</a>></span> <span class="element-name">getItemFlags</span>()</div>
|
|
<div class="block">Get current set itemFlags. The collection returned is unmodifiable.</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>A set of all itemFlags set</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="hasItemFlag(org.bukkit.inventory.ItemFlag)">
|
|
<h3>hasItemFlag</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">hasItemFlag</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemFlag.html" title="enum class in org.bukkit.inventory">ItemFlag</a> flag)</span></div>
|
|
<div class="block">Check if the specified flag is present on this item.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>flag</code> - the flag to check</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>if it is present</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="translationKey()">
|
|
<h3>translationKey</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">translationKey</span>()</div>
|
|
<div class="block">Gets the translation key.
|
|
<p>
|
|
This is not the same as getting the translation key
|
|
for the material of this itemstack.</div>
|
|
<dl class="notes">
|
|
<dt>Specified by:</dt>
|
|
<dd><code><a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/translation/Translatable.html#translationKey()" title="class or interface in net.kyori.adventure.translation" class="external-link">translationKey</a></code> in interface <code><a href="https://jd.advntr.dev/api/4.13.0/net/kyori/adventure/translation/Translatable.html" title="class or interface in net.kyori.adventure.translation" class="external-link">Translatable</a></code></dd>
|
|
<dt>Returns:</dt>
|
|
<dd>the translation key</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="getRarity()">
|
|
<h3>getRarity</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="../../../io/papermc/paper/inventory/ItemRarity.html" title="enum class in io.papermc.paper.inventory">ItemRarity</a></span> <span class="element-name">getRarity</span>()</div>
|
|
<div class="block">Gets the item rarity of the itemstack. The rarity can change based on enchantements.</div>
|
|
<dl class="notes">
|
|
<dt>Returns:</dt>
|
|
<dd>the itemstack rarity</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="isRepairableBy(org.bukkit.inventory.ItemStack)">
|
|
<h3>isRepairableBy</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">isRepairableBy</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a> repairMaterial)</span></div>
|
|
<div class="block">Checks if an itemstack can repair this itemstack.
|
|
Returns false if <code>this</code> or <code>repairMaterial</code>'s type is not an item (<a href="../Material.html#isItem()"><code>Material.isItem()</code></a>).</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>repairMaterial</code> - the repair material</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>true if it is repairable by, false if not</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="canRepair(org.bukkit.inventory.ItemStack)">
|
|
<h3>canRepair</h3>
|
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">canRepair</span><wbr><span class="parameters">(<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a> toBeRepaired)</span></div>
|
|
<div class="block">Checks if this itemstack can repair another.
|
|
Returns false if <code>this</code> or <code>toBeRepaired</code>'s type is not an item (<a href="../Material.html#isItem()"><code>Material.isItem()</code></a>).</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>toBeRepaired</code> - the itemstack to be repaired</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>true if it can repair, false if not</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
<li>
|
|
<section class="detail" id="damage(int,org.bukkit.entity.LivingEntity)">
|
|
<h3>damage</h3>
|
|
<div class="member-signature"><span class="annotations"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
</span><span class="modifiers">public</span> <span class="return-type"><a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a> <a href="ItemStack.html" title="class in org.bukkit.inventory">ItemStack</a></span> <span class="element-name">damage</span><wbr><span class="parameters">(int amount,
|
|
<a href="https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/org/jetbrains/annotations/NotNull.html" title="class or interface in org.jetbrains.annotations" class="external-link">@NotNull</a>
|
|
<a href="../entity/LivingEntity.html" title="interface in org.bukkit.entity">LivingEntity</a> livingEntity)</span></div>
|
|
<div class="block">Damages this itemstack by the specified amount. This
|
|
runs all logic associated with damaging an itemstack like
|
|
events and stat changes.</div>
|
|
<dl class="notes">
|
|
<dt>Parameters:</dt>
|
|
<dd><code>amount</code> - the amount of damage to do</dd>
|
|
<dd><code>livingEntity</code> - the entity related to the damage</dd>
|
|
<dt>Returns:</dt>
|
|
<dd>the damaged itemstack or an empty one if it broke. May return the same instance of ItemStack</dd>
|
|
<dt>See Also:</dt>
|
|
<dd>
|
|
<ul class="see-list-long">
|
|
<li><a href="../entity/LivingEntity.html#damageItemStack(org.bukkit.inventory.EquipmentSlot,int)"><code>to damage itemstacks in equipment slots</code></a></li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
</section>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
</main>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|