Whats up everybody!
I've been engaged on a brand new modding tutorial for Hytale the place standing on any block transforms it into gold (particularly Rock_Gold_Brick_Smooth) after a brief delay.
The way it works: It makes use of an Entity Ticking System, the place i increment a float for the two second timer utilizing delta and if you’re nonetheless standing on the identical block, then it will get became Rock_Gold_Brick_Smooth.
I take advantage of delta time to trace precisely how lengthy you've been standing there. I take advantage of a Vector3i "trick": By changing the Place underneath the Participant to a INT Vector, tiny actions (like sliding barely) don't reset the timer or set off false positives. It solely counts if you’re on the very same block index. Debug Be aware: I initially bumped into thread questions of safety with getBlockType, which I solved by wrapping the logic in world.execute().
You may customise the goal block simply within the code.
Watch the complete step-by-step tutorial right here: Hytale Modding: Flip Blocks into Gold after standing on them (Java Tutorial)
Supply Code is obtainable within the video description!
Let me know when you have concepts for different block transformation mechanics!
submitted by /u/ArkaTale [comments]
Source link
