_onItemCreate(event) {
    event.preventDefault();
    const header = event.currentTarget;
    // Get the type of item to create.
    const type = header.dataset.type;
    // Grab any data associated with this control.
    const data = duplicate(header.dataset);
    // Initialize a default name.
    const name = `New ${type.capitalize()}`;
    // Prepare the item object.
    const itemData = {
      name: name,
      type: type,
      data: data
    };
    // Remove the type from the dataset since it's in the itemData.type prop.
    delete itemData.data["type"];

    // Finally, create the item!
    console.log(itemData);
    return this.actor.createOwnedItem(itemData);
  }
/**
   * Handle creating a new Owned Item for the actor using initial data defined in the HTML dataset
   * @param {Event} event   The originating click event
   * @private
   */
Handle creating a new Owned Item for the actor using initial data defined in the HTML dataset
@param {Event} event   The originating click event
@private
Handle creating a new Owned Item for the actor using initial data defined in the HTML dataset @param { Event } event The originating click event @private
_onItemCreate(event) {
    event.preventDefault();
    const header = event.currentTarget;
    const type = header.dataset.type;
    const data = duplicate(header.dataset);
    const name = `New ${type.capitalize()}`;
    const itemData = {
      name: name,
      type: type,
      data: data
    };
    delete itemData.data["type"];
    console.log(itemData);
    return this.actor.createOwnedItem(itemData);
  }
_onItemCreate ( event ) { event . preventDefault ( ) ; const header = event . currentTarget ; const type = header . dataset . type ; const data = duplicate ( header . dataset ) ; const name = ` ${ type . capitalize ( ) } ` ; const itemData = { name : name , type : type , data : data } ; delete itemData . data [ "type" ] ; console . log ( itemData ) ; return this . actor . createOwnedItem ( itemData ) ; }
Handle creating a new Owned Item for the actor using initial data defined in the HTML dataset
 @param {Event} event   The originating click event
 @private
Handle creating a new Owned Item for the actor using initial data defined in the HTML dataset @param { Event } event The originating click event @private
// Get the type of item to create. // Grab any data associated with this control. // Initialize a default name. // Prepare the item object. // Remove the type from the dataset since it's in the itemData.type prop. // Finally, create the item!