Klasse Items.ItemDefinition

java.lang.Object
net.risingworld.api.definitions.Items.ItemDefinition
Umschließende Klasse:
Items

public final class Items.ItemDefinition extends Object
  • Felddetails

    • id

      public short id
      Internal ID of the item
    • name

      public String name
      Name of the item
    • type

      public Items.Type type
      Item type
    • group

      public Items.Group group
      Item group flags
    • variations

      public int variations
      Number of item variants (see variants array). 0 means there are no additional variants available (only the default variant), 1 means there are two variants (default and 1) etc
    • hand

      public Items.Hand hand
      Determines in which hand this item is being held (0 == left, 1 == right, 2 == none). Basically this just determines which hand the game object gets attached to
    • twohanded

      public boolean twohanded
      Determines if this item is two-handed, i.e held by both hands
    • position

      public Vector3f position
      Item model offset when holding in hands
    • rotation

      public Quaternion rotation
      Item model rotation when holding in hands
    • pickupitem

      public String pickupitem
      Optional other item that gets added to the inventory when picking up this item. Null by default
    • size

      public float size
      Item model size (default: 1.0f)
    • stacksize

      public short stacksize
      Max stack size for this item
    • material

      public Items.Material material
      Item material (i.e the material this item consists of, e.g stone, metal, wood etc)
    • extent

      public Items.Size extent
      Extent / size of the item
    • category

      public Items.Category category
      Item category (e.g tool, medical, weapon etc)
    • strength

      public short strength
      Item strength / hit points
    • durability

      public int durability
      Item durability (number of uses before it breaks). -1 == infinite
    • mass

      public float mass
      Item mass
    • debrismass

      public float debrismass
      Mass for debris
    • collisionlistener

      public boolean collisionlistener
      Determines whether this item requires a collision listener (if spawned as world item)
    • canhavemodifier

      public boolean canhavemodifier
      Gets whether or not this item can have a modifier
    • canswim

      public boolean canswim
      Determines whether of not this item can swim in water
    • npcaction

      public boolean npcaction
      Determines whether the item action is performed if held by a (hostile) npc, or if the npc performs a generic punch when attacking the player
    • defaultstatus

      public short defaultstatus
      Initial status for new items. Default: 0
    • defaultvalue

      public float defaultvalue
      Initial value for new items. Default: 0.0
    • maxstatus

      public short maxstatus
      Max status for items. Default: 0
    • maxvalue

      public float maxvalue
      Max value for items. Default: 0.0
    • resetstatusondrop

      public boolean resetstatusondrop
      If true, the item status will be set to 0 when dropping this item
    • resetvalueondrop

      public boolean resetvalueondrop
      If true, the item value will be set to 0 when dropping this item
    • destroyondrop

      public boolean destroyondrop
      If true, item will be destroyed when being dropped (i.e it does not spawn a world item)
    • customicon

      public boolean customicon
      If true, this item has a custom icon which is generated at runtime
    • renderoffset

      public Vector3f renderoffset
      Optional offset when rendering the item (e.g as custom icon or for crafting preview)
    • renderrotation

      public Quaternion renderrotation
      Optional rotation when rendering the item (e.g as custom icon or for crafting preview)
    • hitsound

      public String hitsound
      Item hit sound. May be null
    • breaksound

      public String breaksound
      Item break sound. May be null
    • collidesound

      public String collidesound
      Item collide sound. May be null
    • placesound

      public String placesound
      Item place sound. May be null
    • pickingInfo

      public Items.PickingInfo pickingInfo
      Picking info for this item. May be null
    • itemInfos

      public Items.ItemInfo[] itemInfos
      All item infos related to this item. May be null
    • consumeInfo

      public Items.ConsumeInfo consumeInfo
      Consume info for this item. May be null
    • variants

      public Items.ItemDefinition.Variant[] variants
      Array containing all item variants. Variant 0 is always the default variant. Never null and always has a minimum size of 1
  • Methodendetails

    • synchronize

      public void synchronize()
    • getVariant

      public Items.ItemDefinition.Variant getVariant(int variant)
      Gets a item variant.
      Parameter:
      variant - the variant. The default variant is always 0. The value is clamped automatically.
      Gibt zurück:
      the item variant.
    • getIcon

      public TextureAsset getIcon(int texture)
      Gets the ingame icon of this item as TextureAsset.
      Parameter:
      texture - the item texture/variant. By default 0.
      Gibt zurück:
      the icon of this item.