Method: Minecraft::Commands#addtimer

Defined in:
lib/minecraft/commands.rb

#addtimer(user, *args) ⇒ Object

Note:

ops: hop

Adds a timer to the requesting users timers, the item and frequency in seconds of the timer should be specified. If the timer already exists for that item, the frequency is re-assigned. If the frequency is unspecified, it will default to 30.

Examples:

addtimer("basicxman", "cobblestone")
addtimer("basicxman", "arrow", "10")

Parameters:

  • user (String)

    The requesting user.

  • args

    item, frequency



529
530
531
532
533
534
535
536
# File 'lib/minecraft/commands.rb', line 529

def addtimer(user, *args)
  item, duration = items_arg(30, args)
  item = resolve_item(item)
  return @server.puts "say Timer was not added." if item.nil?
  @timers[user] ||= {}
  @timers[user][item] = duration
  say("Timer added for #{user}.  Giving item id #{item} every #{duration} seconds.")
end