i need help with an entity that can spawn items.

Started by thijs_films on

Topic category: Help with MCreator software

Last seen on 21:15, 25. Aug 2024
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i need help with an entity that can spawn items.

so im creating a mod with an entity that every in game day spawns a single item.
i have tried things with cooldowns but nothing so far has worked and at this point im back to a blank slate.
if anyone can help i would greatly appreciate it!

Last seen on 00:18, 12. Oct 2024
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is possible with nbt…
Sat, 03/19/2022 - 02:51

This is possible with nbt tags i think and i am not so good with that, so i have a makeshift solution for now.

 

Make a potion effect, then create a "When effect expires".

When effect expires - if (is day in the provided world) do (spawn gem [your item])

 

Then for your entity, go to the "entity tick update".

If Not (is day in provided world) do (add potion effect [the potion effect you made] for [5 ticks]) 

 

The item spawn when its somewhat dark so you can change the ticks in the "expired effect" to a larger number to make it spawn later.

(item spawns at 23500 ticks and one day is 24000 ticks).

 

So this makes the entity drop one item every day, now i only tested this in casual situations but i have no idea how this works for the entity if its for example out of range or on server. Hope this helps for now!

Last seen on 21:15, 25. Aug 2024
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i tried it out and it sadly…
Sat, 03/19/2022 - 17:27

i tried it out and it sadly didn't work.
but thank you for the suggestion!

Last seen on 00:18, 12. Oct 2024
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yea, i tested it in 1.17,…
Sat, 03/19/2022 - 18:23

Yea, i tested it in 1.17, might be different if you are using another version. Hope you can figure something out!

Last seen on 21:15, 25. Aug 2024
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
so, i managed to do it! by…
Sat, 03/19/2022 - 21:30

so, i managed to do it!
by having 2 of the same entity. one that gives the item and then quickly changes into the other that waits untill the next day.
thank you for the help, because before this i didnt know of the 'is day in provided world' trigger before this, so it helped me alot!

Last seen on 00:18, 12. Oct 2024
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I am happy that i was able…
Sun, 03/20/2022 - 12:08

I am happy that i was able to help!