New to modding

Started by Cyber2834 on

Topic category: Help with MCreator software

Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
New to modding

I there a way to make an item that when you use it it start a timer that restarts when the player moves and when the timer has reached a specific value it spawns a block where the player is standing so kinda like a placing animation would do.

Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
make a procedure element…
Thu, 08/03/2023 - 19:16
  1. make a procedure element
    1. find the green block, click on the trigger, and set it to happen every tick
    2. go to the entities tab on the left, find the SET custom nbt NUMBER block, place it under the green block
    3. find the GET custom nbt NUMBER block
    4. go to the logic section and find the [] + [] block
    5. find the block that just says "0" and change it to "1"
    6. put the GET custom nbt block inside the first slot of the [] + [] block, and the "1" block in the second slot
    7. put that whole thing inside the SET custom nbt block
    8. now you should have "SET custom nbt NUMBER tag "timer" to [GET custom nbt NUMBER tag "timer"] + [1]. this makes it so every tick, the timer constantly goes up by 1. basically the timer value is being stored inside the player.
    9. go to the event flow tab and find the if block and put the if block under that entire thing
    10. go to the logic tab and find the [] > [] block and put it inside the if block
    11. find the GET custom nbt block and put it inside the first slot of the [] > [] block
    12. find the "0" block, set it to however many ticks you want to wait before spawning the block (for example, spawning a block every 1 second would be 20 ticks, every 3 seconds would be 60 ticks, every 30 seconds would be 600 ticks), put that inside the second slot of the [] > [] block
    13. go to block management tab and find the place block
    14. set the block to whatever you want to place
    15. put that inside the if block
    16. now it should place the block
  2. make another procedure element
    1. in the green block, set this to trigger when the player moves
    2. under the green block, use the SET custom nbt NUMBER block to set to 0

it should work now

also make sure to always use the exact same name for the nbt blocks inside the text field, for example every time it should be spelled "timer" not "timr" or "tiemr"