/// <summary> /// Intializes a new <see cref="Attribute"/> /// </summary> /// <param name="type">The type of attribute</param> /// <param name="operation">The attribute operation to use</param> /// <param name="value">The value to use in the operation</param> /// <param name="slot">The slot the attribute effect works in</param> public Attribute(ID.AttributeType type, ID.AttributeOperation operation, MCRange value, ID.AttributeSlot slot) { Type = type; Operation = operation; Value = value; Slot = new ID.AttributeSlot[] { slot }; }
/// <summary> /// Intializes a new <see cref="ItemAttribute"/> /// </summary> /// <param name="attribute">The attribute the item should modify</param> /// <param name="slot">The slot the item has to be in for the modifier to work</param> /// <param name="name">The name of the modifier. Leave null to use UUID as name</param> /// <param name="amount">The amount to modify with</param> /// <param name="operation">The way to modify</param> /// <param name="uuid">The UUID of the modifier. Leave null to generate a UUID.</param> public ItemAttribute(ID.AttributeType attribute, ID.AttributeSlot slot, double amount, ID.AttributeOperation operation, string?name = null, UUID?uuid = null) { Attribute = attribute; Slot = slot; Amount = amount; Operation = operation; UUID = uuid ?? new UUID(); Name = name ?? UUID.UUIDString; }