Timed actions
In this page you will learn how to timer stuff to happen in your block, for example:
- Summoning an item each "x" second
 - Triggering an activator and displaying the cooldown on top of the block
 - Or executing whatever you want and displaying it on the block.
 
Method
Variable
- You first have to create a variable, let's call this timer
-c8b05be9913d9a519401c6c694f079da.png)
-a03a612abd36fd4ab66066f81c50c5b1.png)
-359278accc82e8457fad6792fd4f3557.png)
- TYPE: NUMBER because it it will be a TIMER, so it is an integer value.
 -267325d99d3277636d06037110998bee.png)
-08a372d6f162176d666cc5e6086a5d88.png)
 
TITLE
- 
Go to Title features and display the variable there using the placeholder %var_<variablename>_int%
 
LOOP ACTIVATOR
- Now create a LOOP activator with variableModification timer MODIFICATION -1 and placeholderCondition PLAYER_NUMBER %var_timer% SUPERIOR than 0.
 
ACTION
- Here is UP TO YOU, and will depend on your needs, in this case let's make a couple of examples
- 
RIGHT CLICK and take an ITEM
- activator RIGHT CLICK
 - placeholderCondition %var_timer% EQUALS 0
 - command:
execute in <<%block\_world%>> run summon item %block\_x% %block\_y%+1 %block\_z% \{Item:\{id:"minecraft:IDOFTHEITEM",Count:1b\\}\}
 - variableModification: timer SET 10
 
 - 
Each time the timer goes to 0 summon an item
- activator LOOP
 - placeholderCondition PLAYER_NUMBER %var_timer% EQUALS 0
 - command:
execute in <<%block\_world%>> run summon item %block\_x% %block\_y%+1 %block\_z% \{Item:\{id:"minecraft:IDOFTHEITEM",Count:1b\\}\}
 - variableModification: timer SET 10
 
 - 
Example
 
 - 
 
creationType: BASIC_CREATION
name: Timed Block
lore:
- '&b&oDefault lore'
material: STONE
dropType: IN_THE_INVENTORY
usage: -1
canBeMoved: true
config_3: true
config_update: true
titleOptions:
  activeTitle: true
  title:
  - '§6Time: §e%var_timer_int%'
  titleAdjustement: 0.5
activators:
  activator0:
    name: '&eActivator'
    option: LOOP
    usageModification: 0
    cancelEvent: false
    requiredItems: {}
    requiredExecutableItems: {}
    requiredMagics: {}
    commands: []
    blockConditions: {}
    worldConditions: {}
    placeholdersConditions:
      plchCdt0:
        type: PLAYER_NUMBER
        comparator: SUPERIOR
        part1: '%var_timer%'
        part2: '0'
        cancelEventIfNotValid: false
        messageIfNotValid: ''
        messageIfNotValidForTarget: ''
        stopCheckingOtherConditionsIfNotValid: true
    # Reduce the variable (timer)
    variablesModification:
      varUpdt0:
        variableName: timer
        type: MODIFICATION
        modification: -1.0
    delay: 1
    delayInTick: false
    ownerCommands: []
    ownerConditions: {}
  activator1:
    name: '&eActivator'
    option: LOOP
    usageModification: 0
    cancelEvent: false
    requiredItems: {}
    requiredExecutableItems: {}
    requiredMagics: {}
    commands:
    - STRIKELIGHTNING
    blockConditions:
      requiredItems: {}
      requiredExecutableItems: {}
    worldConditions: {}
    placeholdersConditions:
      plchCdt0:
        type: PLAYER_NUMBER
        comparator: EQUALS
        part1: '%var_timer%'
        part2: '0'
        cancelEventIfNotValid: false
        messageIfNotValid: ''
        messageIfNotValidForTarget: ''
        stopCheckingOtherConditionsIfNotValid: true
    # Reset the timer
    variablesModification:
      varUpdt0:
        variableName: timer
        type: SET
        modification: 10.0
    delay: 1
    delayInTick: false
    ownerCommands: []
    ownerConditions: {}
variables:
  var0:
    variableName: timer
    type: NUMBER
    default: 10.0
    isRefreshableClean: true
    refreshTagDoNotEdit: §他§他§自§天§生§人§人§心§道
-f2051d1ead60cb2e2acf1cc1c88b3804.png)
-1f616a47e2a1083520fba0d0a8888f05.png)
-5ef17ecd7edce5f6c310b40ee99fffc2.png)
-043335b29bb49a036ed85def54c056ef.png)
-ed4c0ca70f7da1065f0b650c3b8f362d.png)