Method: Minecraft::Commands#give

Defined in:
lib/minecraft/commands.rb

#give(user, *args) ⇒ Object

Note:

ops: hop

Note:

all: is putting out.

Give command takes an item name or numeric id and a quantifier. If a quantifier is not specified then the quantity defaults to 1. Items will try to resolved if they are not an exact match.

Examples:

give("basicxman", "cobblestone")
give("basicxman", "cobblestone", "9m")
give("basicxman", "flint", "and", "steel", "1")
give("basicxman", "4")

Parameters:

  • user (String)

    Target user of the command.



366
367
368
369
370
371
372
373
374
375
376
377
# File 'lib/minecraft/commands.rb', line 366

def give(user, *args)
  item, quantity = items_arg(1, args)
  # For coloured wools/dyes.
  if WOOL_COLOURS.include? item
    (quantity / 64.0).ceil.times { kit(user, item) }
    item = 35
  else
    item = resolve_item(item)
  end

  construct_give(user, item, quantity)
end