Posted November 4, 20168 yr I would like to have some "special effects" before spawning an item in the world, and for that i need some sort of timer. E.G for 5 seconds spawn particles, after that spawn the item. I know minecraft uses Tick as it's time unit but how do i utilize ticks in methods? For example onItemRightClick method? I was thinking of using Java TimerTasks but i would like to know if there's a better way using minecraft Ticks
November 4, 20168 yr Author You need to subscribe to ServerTickEvent / ClientTickEvent and count Any example? Or if you know any mod that uses this i can have a look myself.
November 4, 20168 yr Author I like the new forgeDocumentation. It's pretty neat. Actually i am not sure if it is that new since i haven't been active for months. As for the main point, I do know how to set-up events, i just wanted an example of someone using it. Anyway i just remembered. Blocks and Items have a "onUpdate" method right? I can use that and a variable to work something out. I am not very sure how you would get if the player is right clicking a block through events though, never tried something like that. Thank you for the time
November 4, 20168 yr I like the new forgeDocumentation. It's pretty neat. Actually i am not sure if it is that new since i haven't been active for months. As for the main point, I do know how to set-up events, i just wanted an example of someone using it. Anyway i just remembered. Blocks and Items have a "onUpdate" method right? I can use that and a variable to work something out. I am not very sure how you would get if the player is right clicking a block through events though, never tried something like that. Thank you for the time Note a variable on an Item is shared between all in game instances. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
November 4, 20168 yr Author Also note that onUpdate will only be called while an Item is in the player's inventory. And for Blocks you would need a TileEntity . And TileEntities onUpdate will only be called if it exists in the world? Then i don't really need any "fancy" way since these restriction don't really prevent anything of what i am planing to do.
November 4, 20168 yr Author Last time i worked on forge there was something like IUpdatePlayerListBox that you had to implement into your tile-entity to get "onUpdate" Is that gone now?
November 4, 20168 yr Last time i worked on forge there was something like IUpdatePlayerListBox that you had to implement into your tile-entity to get "onUpdate" Is that gone now? Yes you use ITickable and not the client one. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
November 4, 20168 yr Author Alright thank you for helping me, both of you. And i am sorry for the inconvenience. ~Have a nice day.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.