Trouble with getting dropped items to... "tick"

Started by SnailsAttack on Tue, 10/13/2020 - 13:20

Topic category: Help with MCreator software

Last seen on 02:14, 25. Nov 2020
Joined Oct 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Trouble with getting dropped items to... "tick"
Tue, 10/13/2020 - 13:20

I'm having trouble w/ something, would appreciate some guidance.

What I'd like to have happen is for any item of a specific identity which is dropped in the world to persist for 5 seconds until it blows up, with some specified conditions, all the while firing off sounds and particle effects and such.

I managed to make this work perfectly when the item is being held by the player, where a variable called "TickCount1" is set up to advance by 20 ticks per second and act as my event sequencer.

-

I can trim this down though, since it doesn't progress very far.

https://cdn.discordapp.com/attachments/765559989548089374/765560746264231956/unknown.png

So basically I want it to increase the "TickCount2" variable [not to be confused with TickCount1, though they are functionally identical] by 20 ticks per second whenever my test item is present on the ground in the form of the dropped item entity under sufficiently bright lighting, and then print which tick it's currently on. So it should print 20 times a second, counting by 20 each time.

However, the event only triggers a single time when the item is first dropped, and it must be dropped by a player, not by any source as I would like.

It also treats this variable as being universal, and not exclusive to the dropped item. Every time I drop the specified item, it triggers the event a single time and essentially "counts" for me.

-

So, like, in this image I made a new world, dropped 3 of the item, and each one triggered a single time and increased the same variable by one tick, then printed it to the chat. Clearly I'm doing things incorrectly.

 

TLDR; how do I make a dropped item entity tick 20 times per second to run an event sequence, and prevent them from sharing the same global variable?

 

Last seen on 02:14, 25. Nov 2020
Joined Oct 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I watched both tutorials and…
Tue, 10/13/2020 - 20:04

I watched both tutorials and still couldn't figure it out. Sorry. I don't think they quite cover what I'm trying to do, but they did help a bit.

I basically need to somehow outsource my timer and sequencer to their own procedure which runs every time the world ticks, but I don't know how to "connect" the events it causes back to my specified item.

Last seen on 14:00, 22. Nov 2020
Joined Jun 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
global variables? you should…
Tue, 10/13/2020 - 23:23

global variables?

you should use mob nbt instead, which is per mob

Last seen on 02:14, 25. Nov 2020
Joined Oct 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Oh alright. I'm still not…
Wed, 10/14/2020 - 00:05

Oh alright. I'm still not sure how to do what I said in my previous reply, though.