#server-plugins-read-only
1 messages ยท Page 117 of 1
unfortunately not ๐ since the translations are preset for assets and not for an individual object
Thas funny, Iโm also making a warhammer fantasy mod
alguien espaรฑol para jugar hytale
Hi ive been disconnecting a player via an event and using PacketHandlers, but when I do, all players in the server or world idk which it is, get disconnected.
how can i get the drop of an item?
blockType.getItem()```
hello all, looking for help getting friends onto my server. I've set it up, but when i try to join via my public IP i can't access it. I've set up the port forwarding, but i'm using LAN via a mesh which i think is messing up the connection. anyone got experience with something like this? Thanks!
In the world config I have disabled Fall Damage. It doesnt seem to have taken effect. Is this a known bug?
via the BlockType: worldChunk.getBlockType(targetBlock); the blocktype should contain info about Gathering -> Breaking -> DropList
or how am I supposed to cancel it? I wasn able to find like a DamageCause Enum or something
Also if this is the wrong spot for the message, point me to the most relevant tech help section
The only way to do it currently is to create your own asset. So if you want to mimic a sword then clone from the vanilla asset and alter it so its sent to client. Hopefully they will improve this as it doesnt make sense to go through all this work to simply have custom item descriptions.
Ok but does that work in runtime? can I use that system to enable a player to rename his sword for example?
Hey @random briar can you provide a working example? Below is what I have and it does not trigger when using the "F" interaction.
BuilderCodec.builder(PlayerInteractSystem.class, PlayerInteractSystem::new,
SimpleBlockInteraction.CODEC)
.documentation("Handles player block interactions for regeneration areas")
.build();
// Register with the interaction codec registry
plugin.getCodecRegistry(Interaction.CODEC).register(
"harvest-area-protection", // Unique identifier
SimpleBlockInteraction.class, // Class type
build // The codec
);
}
private class PlayerInteractSystem extends UseBlockInteraction {
@Override protected void interactWithBlock(@NonNullDecl World world,
@NonNullDecl CommandBuffer<EntityStore> commandBuffer,
@NonNullDecl InteractionType type, @NonNullDecl InteractionContext context,
@NullableDecl ItemStack itemInHand, @NonNullDecl Vector3i targetBlock,
@NonNullDecl CooldownHandler cooldownHandler) {```
seems like it only works with one codec, tried to make for worldguard and chunk claim, so i made just one mod for that
how do I change a blockstate from within code? I want a block to begin animating when a player gets nearby, similar to a minecraft enchantment table
public static final BuilderCodec<PlayerInteractSystem> USE_CODEC =
BuilderCodec.builder(PlayerInteractSystem.class, PlayerInteractSystem::new, SimpleBlockInteraction.CODEC)
.documentation("Interaction Use Event")
.build();
protected void interactWithBlock(@NonNullDecl World world,
@NonNullDecl CommandBuffer<EntityStore> commandBuffer,
@NonNullDecl InteractionType type,
@NonNullDecl InteractionContext context,
@NullableDecl ItemStack itemInHand,
@NonNullDecl Vector3i targetBlock,
@NonNullDecl CooldownHandler cooldownHandler) {
if (type.equals(InteractionType.Use)) {
}
}
and get context to get interaction manager and chain use the chain to cancel
interactionManager.cancelChains(chain);
how do i get into the server setting? for example pvp and stuff like that
do /help and find world command, it can show you from there
is that in game?
it was last time i played it
Hi, is there a way to display only nearby players in the Map
What is the difference between @severe ivy and your code snippet? maybe im blind but it looks the same to me. The interactWithBlock is just not called at all
Do you have a link perhaps to a full example ?
or is there no need for registering the codec and it does that automatically on build
think he made a mistake by not using his class
the class name PlayerInteractSystem is what i called my class
BuilderCodec<PlayerInteractSystem> USE_CODEC =
BuilderCodec.builder(PlayerInteractSystem.class, PlayerInteractSystem::new, SimpleBlockInteraction.CODEC)
he might also not register the code
protected void setup() {
super.setup();
getCodecRegistry(Interaction.CODEC).register("UseBlock", PlayerInteractSystem.class, PlayerInteractSystem.USE_CODEC);
}
ah thank you. registering is done in his code, but the wrong class is provided. i see now
Is there a way to copy over the components when updating a state on a block?
I'm looking to create a rankup because it's lighter, does anyone know of a good mod for plots and rank-ups?
Is there any clear docs?
I'm getting this:
[2026/02/08 17:36:33 SEVERE] [Hytale] Exception in thread Thread[#143,WorldThread - default,5,InnocuousForkJoinWorkerThreadGroup] potentially caused by com.anare:AnareCore:
java.util.ConcurrentModificationException
at java.base/java.util.ArrayList$Itr.checkForComodification(Unknown Source)
at java.base/java.util.ArrayList$Itr.next(Unknown Source)
at ThirdParty(com.anare:AnareCore)//AnareCore.Components.ResourceRegenComponent.PassTime(ResourceRegenComponent.java:44)
at ThirdParty(com.anare:AnareCore)//AnareCore.CastingSystems.AnareResourceRegenerationSystem.tick(AnareResourceRegenerationSystem.java:51)
at com.hypixel.hytale.component.system.tick.EntityTickingSystem.doTick(EntityTickingSystem.java:92)
at com.hypixel.hytale.component.system.tick.EntityTickingSystem.tick(EntityTickingSystem.java:36)
at com.hypixel.hytale.component.Store.tick(Store.java:1974)
at com.hypixel.hytale.component.system.tick.ArchetypeTickingSystem.tick(ArchetypeTickingSystem.java:36)
at com.hypixel.hytale.component.Store.tickInternal(Store.java:1930)
at com.hypixel.hytale.component.Store.tick(Store.java:1900)
at com.hypixel.hytale.server.core.universe.world.World.tick(World.java:454)
at com.hypixel.hytale.server.core.util.thread.TickingThread.run(TickingThread.java:95)
at java.base/java.lang.Thread.run(Unknown Source)
I imagine it's because of
Ref<EntityStore> inner_ref = archetypeChunk.getReferenceTo(index);
var regenComponent = commandBuffer.getComponent(inner_ref, ResourceRegenComponent.TYPE);
regenComponent.PassTime(dt);
with PassTime being
public void PassTime(float deltaTime)
{
for (ResourceRegen Regen : RegenList) {
Regen.TimeLeft -= deltaTime;
if (Regen.TimeLeft <= 0) RegenList.remove(Regen);
}
}
I'm trying to allow a statue to apply a special regeneration effect on the player for a custom mana implementation
@devout harness whats the declaration of RegenList?
RegenList.remove(Regen) is being called by separate threads by the looks of it.
public class ResourceRegenComponent implements Component<EntityStore> {
public static ComponentType<EntityStore, ResourceRegenComponent> TYPE;
public List<ResourceRegen> RegenList = new ArrayList<>();
public ResourceRegenComponent() {
}
public ResourceRegenComponent(ResourceRegen Regen) {
RegenList.add(Regen);
}
public boolean AddRegen(ResourceRegen Regen) {
if (RegenList.stream().anyMatch(r -> Objects.equals(r.Source, Regen.Source))) {
RegenList.stream().filter(r -> Objects.equals(r.Source, Regen.Source)).findFirst().ifPresent(r -> r.TimeLeft = Regen.TimeLeft);
return false;
}
return RegenList.add(Regen);
}
public String GetAllRegen() {
if (RegenList.isEmpty()) return "No Regen";
StringBuilder RegenString = new StringBuilder();
for (ResourceRegen Regen : RegenList) {
RegenString.append(Regen.Source).append(" ").append(Regen.ModifierValue).append(" ").append(Regen.Type).append("\n");
}
return RegenString.toString();
}
public void PassTime(float deltaTime)
{
for (ResourceRegen Regen : RegenList) {
Regen.TimeLeft -= deltaTime;
if (Regen.TimeLeft <= 0) RegenList.remove(Regen);
}
}
@NullableDecl
@Override
public Component<EntityStore> clone() {
return new ResourceRegenComponent();
}
}
I did have 2 statues standing next to eachother, is that causing issues?
I guess that's already kind of stupid, as it'll tick down multiple times in a single second
that new ArrayList<>();
Looks to be the problem. Im not sure if you are expecting multiple threads to be operating on that collection. If not you should figure out why.
If you are, new ArrayList should either be new CopyOnWriteArrayList() or Collections.synchronizedList()
Yea, try to use Iterator. When you use forEach and change the list - it fails
Do I make both of these changes or one of these?
public void PassTime(float deltaTime)
{
Iterator<ResourceRegen> iterator = RegenList.iterator();
iterator.forEachRemaining(r -> r.TimeLeft -= deltaTime);
RegenList.removeIf(r -> r.TimeLeft <= 0);
}
is this better?
Anyone knows how to disable player colliding only with other players?
What's the difference between the Class BlockType (which implements Component<EntityStore>) and the Holder<ChunkStore> that you get returned by blockType.getBlockEntity() ?
I thought BlockEntity either is of type Component<ChunkStore> or Component<EntityStore>?
Yea, should work, but run through the list twice ๐
I have one method as example for you (kotlin):
fun tickUpgrades() { val iterator = activeUpgrades.iterator() while (iterator.hasNext()) if (--iterator.next().value.tickLeft <= 0L) iterator.remove() }
Can anyone help me? How do I stop the Hytale Create default world on startup?
Change Defaults.World in your server's config.json
does someone knows how to draw zones like the selection tool does? are at leas have a hint what class its in?
its not the debug shape, they are ugly solid and show lines of the vertexes
its in the world config in universe/worlds/worldname/config.json
ehehehe, i finally found time to build a reverse proxy on my vpn
found the answer, for reference: set the second bit of the settings bitmask. It will disable state and block entity updates, which will not replace the components and keep the state as is.
Did any of yall tried to host a server on your computer. I have an issue when i try to run server.bat to install all of server files it does not want to open(it closes instantly when i open it)
whats the content of your server.bat
and make sure that the spelling and capitalisation aligns
sorry i meant start.bat
like its just a file that opens cmd
it instantly closes for some reason
open cmd and run the start.bat from there. that will show you the error
yea im doing the same for my server but it keeps console, can you dm a screenshot of the .bat and the folder its in
yea sure
or add pause at the end
Do you guys have a good way to delete a world and teleport all players from that world properly ? Everytime i try to delete a world via
Universe.get().removeWorld(worldName)
It works and i can see the world beeing removed for the file system but not When players are inside. When players are inside the world doesnt really get deleted. Any one experience with that?
That's exactly what the WorldRemoveCommand does so you should be good. What's the error message?
There is no error. Thats the weird part when i execute that method to remove a world but players are still inside it doesnt remove it
how to get eventbus in main class?
Hi there! How can I block interaction with plants?
I'm using the block interact event โ it blocks every block and plants that were seeded with the Eternal Seed, but not plants from normal seeds.
HytaleServer.get().getEventBus()
thanks
??
Also the client that were inside the world while beeing deleted cant rejoin the server anymore
is there any documentation for "InteractionVars" in the json assets?
Anyone here good with CustomUIs? Im failing to append a list of strings to my .ui file as labels
set delete on remove to true in the world config, add a world empty removal condition, tp all players out of the world and let the system delete it for you.
What do you mean by that? add a world empty removal condition
uhh
should be something like
WorldConfig config = world.getWorldConfig();
InstanceWorldConfig instanceConfig = InstanceWorldConfig.ensureAndGet(worldConfig);
instanceConfig.setRemovalConditions(new WorldEmptyCondition());
pretty sure you can do it in json too
Ohh thats cool what changes when i do that?
when there's no players in the world it gets removed (not deleted)
and you can set in the world config to delete worlds once they're removed
Does that mean the world gets automatically deleted when no players are inside?
it makes sure a player has been in the dimension first, but yes.
there's a check for hadPlayer in the instance data
Intersting. will keep that in mind but in my case the player can decide with a command to delete the world
well then in the command I would just run that java code - should be fine
it'll set that world to delete on removal, and then you InstancesPlugin.exitInstance the players in the world and the system deletes it afterwards.
Ah ok pretty interesting
Is anyone familiar with .ui? im trying to get a outline on a ItemSlot but its not working for some reason
ItemSlot #Slot0 { Anchor: (Width: @SlotSize, Height: @SlotSize); OutlineSize: 10; OutlineColor: #ff0000; }
I understand! pretty smart! Thanks for the input will try that out
lots of good reference stuff for the InstancesPlugin in the PortalsPlugin to look at (at least imo).
public static void DeleteHideout(PlayerRef playerRef) {
HytaleLogger.getLogger().atInfo().log("HideoutManager - DeleteHideout - START");
World playerHideout = Universe.get().getWorld(playerRef.getUuid());
if (playerHideout == null) return;
World defaultWorld = Universe.get().getWorld("default");
if (defaultWorld == null) return;
var playerRefs = playerHideout.getPlayerRefs();
if (playerRefs.size() != 0) {
InstanceWorldConfig instanceConfig = InstanceWorldConfig.ensureAndGet(playerHideout.getWorldConfig());
instanceConfig.setRemovalConditions(new WorldEmptyCondition());
for (PlayerRef pRef : playerRefs) {
HytaleLogger.getLogger().atInfo().log("WorldEvents - OnWorldRemove - DOING - TELEPORTING ACTIVE PLAYER TO DEFAULT WORLD");
TeleportUtils.TeleportPlayerToWorld(pRef, defaultWorld, new Transform(0, 81, 0));
}
} else {
InstancesPlugin.safeRemoveInstance(playerHideout);
Universe.get().removeWorld(playerHideout.getName());
}
HytaleLogger.getLogger().atInfo().log("HideoutManager - DeleteHideout - FINISH");
}
I tried this but when the deleteHideout gets executed and players are inside i can see the players are beeing teleported out. I expected after teleported out the world would get deleted or do i have to do something else too ?
The issue is your if/else logic. When players are inside, the code enters the if block, teleports them, and then finishes. It never reaches the else block where the actual removeWorld call sits.
Is there a way to change the base permission for commands?
Is it possible to create plugins without the Hytale API?
// add deleteonremove=true to the world config
// add your removal condition...
// if you go to com.hypixel.hytale.builtin.instances.removal you can read the codec builder docs to see how these properties are used.
// remove the players.
for( PlayerRef ref : playerRefs ) {
// exitInstance tries to get the return point set by the entity or the world config if it's not present.
// you can/should set this when you create the instance.
InstancesPlugin.exitInstance(playerRef.getReference(),playerRef.getReference().getStore()); // cache the store probably
}
// grab a snack, the world should cleanup on its own. this is how the portal plugin does it afaik.
I'd approach it like this
You can see this:
Permission System
Setting Permissions
public class MyCommand extends CommandBase {
public MyCommand() {
super("mycommand", "description");
// Explicit permission
requirePermission("hytale.custom.mycommand");
// Alternatively, use the helper for standard format
requirePermission(HytalePermissions.fromCommand("mycommand"));
}
}
Permission Generation
If no permission is explicitly set, permissions are automatically generated:
System commands: hytale.system.command.<name>
Plugin commands: <plugin.basepermission>.command.<name>
Subcommands: <parent.permission>.<name>
Permission Groups
// Assign to a game mode permission group
setPermissionGroup(GameMode.Adventure);
setPermissionGroup(GameMode.Creative);
// Assign to multiple groups
setPermissionGroups("Adventure", "Creative");
Argument-Level Permissions
private final OptionalArg<PlayerRef> playerArg =
withOptionalArg("player", "desc", ArgTypes.PLAYER_REF)
.setPermission("mycommand.target.other");
Checking Permissions
Java
// During command execution
if (context.sender().hasPermission("some.permission")) {
// Permission granted
}
// Utility method (throws NoPermissionException if permission is denied)
CommandUtil.requirePermission(context.sender(), "some.permission");
wdym ?
That seems like a good approach could you accept my friend request. Would have some more questons about Instances if you dont mind
I'd prefer to keep assistance to the public forum. I don't wanna be DenverCoder9.
public static void DeleteHideout(PlayerRef playerRef) {
HytaleLogger.getLogger().atInfo().log("HideoutManager - DeleteHideout - START");
World playerHideout = Universe.get().getWorld(playerRef.getUuid());
if (playerHideout == null) return;
World defaultWorld = Universe.get().getWorld("default");
if (defaultWorld == null) return;
var playerRefs = playerHideout.getPlayerRefs();
if (!playerRefs.isEmpty()) {
InstanceWorldConfig instanceConfig = InstanceWorldConfig.ensureAndGet(playerHideout.getWorldConfig());
instanceConfig.setRemovalConditions(new WorldEmptyCondition());
for (PlayerRef pRef : playerRefs) {
HytaleLogger.getLogger().atInfo().log("Teleporting player " + pRef.getName() + " to default world");
TeleportUtils.TeleportPlayerToWorld(pRef, defaultWorld, new Transform(0, 81, 0));
}
}
InstancesPlugin.safeRemoveInstance(playerHideout);
Universe.get().removeWorld(playerHideout.getName());
HytaleLogger.getLogger().atInfo().log("HideoutManager - DeleteHideout - FINISH");
}
I don't know if this work so tell me if it's good
Thank you
The problem is i cant remove the world and teleport the players in the same tick thats why the if else statement is there
When you try to do that file system gets locked and the world doesnt get deleted
why you do'nt evacuate all the players before delete the world?
thats what the deleteHideout is doing the first time you call it it first removes all players, and the second time it then can remove it properly
I'm trying to write an NPC action that will take an item from an adjacent chest, I've successfully got it to find the coordinates of one of these chests, but I can't get it to actually take an item from the chest because I can't find a way to access the actual container object just based on world coordinates. I'd assume that it's a block entity of some form but I just cannot figure out how to get from coordinates to container.
It's also entirely possible I'm just thinking about this entirely the wrong way, so tell me if I'm being dumb :P
public class ActionTakeFromNearbyStorage extends ActionBase {
private static final HytaleLogger LOGGER = HytaleLogger.forEnclosingClass();
protected final int quantity;
public ActionTakeFromNearbyStorage(@NotNull BuilderActionTakeFromNearbyStorage builder, @Nonnull
BuilderSupport builderSupport) {
super(builder);
this.quantity = builder.getQuantity(builderSupport);
}
public boolean execute(
@Nonnull Ref<EntityStore> ref,
@Nonnull Role role,
InfoProvider sensorInfo,
double dt,
@Nonnull Store<EntityStore> store
) {
super.execute(ref, role, sensorInfo, dt, store);
ComponentType<EntityStore, NPCEntity> component = NPCEntity.getComponentType();
assert component != null;
NPCEntity npcEntity = store.getComponent(ref, component);
assert npcEntity != null;
World world = npcEntity.getWorld();
assert world != null;
// Check surrounding blocks
Vector3i containerPos = findNearbyContainer(npcEntity);
if (containerPos == null) {
return false;
}
Vector3i npcPos = npcEntity.getOldPosition().toVector3i();
Holder<ChunkStore> holder = world.getBlockComponentHolder(
containerPos.x, containerPos.y, containerPos.z
);
// Maybe? No idea...
return false;
}
private @Nullable Vector3i findNearbyContainer(NPCEntity npcEntity) {
World world = npcEntity.getWorld();
assert world != null;
Vector3i pos = npcEntity.getOldPosition().toVector3i();
// Check surrounding blocks
Vector3i[] directions = {
new Vector3i(0,0,-1),
new Vector3i(1,0,0),
new Vector3i(0, 0, -1),
new Vector3i(-1, 0, 0)
};
// Shuffle order to prevent order of check being predictable
List<Vector3i> shuffled = Arrays.asList(directions);
Collections.shuffle(shuffled);
for (Vector3i dir : shuffled) {
BlockType type = world.getBlockType(pos.add(dir));
if (type == null) {continue;}
String blockID = type.getId();
if (blockID == null) {continue;}
if (blockID.equals("container")) {
return pos.add(dir);
}
}
return null;
}
}
if i have a money system that gives me money killing monsters and mining ores, would i be able to implement the same thing for harvesting crops?
But as rlemon mentioned this seems to be the better way to make the world handle itself instead of me
no reason why not
the question is how would i add it to the current mod? config file doesnt have anything relating to harvesting or crops
I created a jobs plugin with a economy plugin instead
so i can confirm this work fine.
I'm not sure exactly how you'd do it, you'd have to figure that out by yourself. You might need to write actual code and not just change assets.
With events, i mean you can found it on hytaleDocs, it's not an official doc but somes events work fine for me
sadly im a basic noob with only be able to edit, not write it.
why not learn? :D
Fair! Could you send me the plugin that uses the logic with instances so i could take a look at?
it's the PortalsPlugin built in
Honestly dont even know where to start, ive learned slight json modding from scap mechanic and thats bout it
Create your own plugin is better then waiting an update or a feature from the author ^^
yea thats what im trying to do lol, Theeconomy mod died and its what i use currently for a money system and shop together
W3Schools is good for learning Java, lots of resources online. Then once you feel like you have a decent grasp on Java you can look at making Hytale mods. It won't be a quick fix or anything like that
ill check it out, ive got tons of ideas just cant bring em to life yet
Dumb Q time : is there a way to change my server's version? like from Pre to release? . was trying to change from pre-release to release, but im getting the following (any help is welcome):
Caused by: java.lang.IllegalArgumentException: Version 4 is newer than expected version 3
glhf
#1 thing to remember with Java, is that it will want to make you break your computer. You must not give in to the temptation.
how so? lol
Java likes to be annoying. It's one of those programming languages. The specific things that annoy people vary from person to person, but Java is nothing if not good at finding a way to annoy everyone in slightly different ways. If you're lucky you might not run into anything that you find annoying, but be prepared for if you do.
public class DeleteHideoutCommand extends CommandBase {
public DeleteHideoutCommand() {
super("yo_delete_me", "deletes the thing from the thing");
this.setPermissionGroup(GameMode.Adventure);
}
@Override
protected void executeSync(@Nonnull CommandContext ctx) {
Ref<EntityStore> pRef = ctx.senderAsPlayerRef();
Store<EntityStore> store = pRef.getStore();
World world = store.getExternalData().getWorld();
WorldConfig worldConfig = world.getWorldConfig();
InstanceWorldConfig instanceConfig = InstanceWorldConfig.ensureAndGet(worldConfig);
worldConfig.setDeleteOnRemove(true);
// instanceConfig.setReturnPoint(); // if you wanna force a return point
instanceConfig.setRemovalConditions(new WorldEmptyCondition());
world.getPlayerRefs().stream()
.map(PlayerRef::getReference)
.filter(Objects::nonNull)
.forEach(ref -> InstancesPlugin.exitInstance(ref,store));
}
}
@distant crane here's my good deed for the day ๐ untested of course. but should get the idea across.
I'll pay whoever discovers the reason why players on my server are randomly disconnecting, or sometimes the host itself disconnects for no reason.
I fear that may just be programming in general, not a Java specific thing :p
Thank you so mcuh! Ill look into that. Btw what exactly is the instance plugin it confuses me a bit? So i can create a world and instances of that world or ? I think i have a majour confusion here : D
As someone who has used other languages, it's not the same. Java is one of the languages that has the issue worse than average. Now granted, Java isn't as bad as JS. JS is in a tier of it's own. So compared to JS Java is closer to the other languages.
anyone want to make a server with me or smth open to any ideas
if you open up saves/universe/worlds/<name> you'll see a config.json, that's the specifc config for that world instance. if you look in Assets/Server/Instances/ you'll see some bson files (open as text) which are the configs for creating those instance worlds. that's my understanding, might be wrong.
could you please check the following, it should be correct. the first part is called during plugin setup. I expect a log on interaction. But I do not get one.
in setup ->
BuilderCodec<PlayerInteractSystem> build =
BuilderCodec.builder(PlayerInteractSystem.class, PlayerInteractSystem::new,
SimpleBlockInteraction.CODEC)
.documentation("Handles player block interactions for regeneration areas")
.build();
// Register with the interaction codec registry
plugin.getCodecRegistry(Interaction.CODEC).register(Priority.NORMAL.before(100),
"harvest-area-protection", // Unique identifier
PlayerInteractSystem.class, // Class type
build // The codec
);
}
----
private class PlayerInteractSystem extends UseBlockInteraction {
@Override protected void interactWithBlock(@NonNullDecl World world,
@NonNullDecl CommandBuffer<EntityStore> commandBuffer,
@NonNullDecl InteractionType type, @NonNullDecl InteractionContext context,
@NullableDecl ItemStack itemInHand, @NonNullDecl Vector3i targetBlock,
@NonNullDecl CooldownHandler cooldownHandler) {
plugin.getLogger().atInfo()
.log("Player interacted with block at " .....
@random briar hey
How to intercept/block ChangeBlockInteraction and HarvestCropInteraction from a separate plugin?
These two interaction types modify the world directly without firing any ECS events:
ChangeBlockInteraction.interactWithBlock()callschunk.setBlock()directlyHarvestCropInteraction.interactWithBlock()callsFarmingUtil.harvest()โchunk.breakBlock()directly
Neither fires BreakBlockEvent, PlaceBlockEvent, UseBlockEvent, or any other cancellable event.
I've tried:
- Cancelling
PlayerInteractEventโ doesn't stop the chain - Calling
InteractionManager.clear()from event handlers โ chain still executes - All available ECS events (
UseBlockEvent.Pre,BreakBlockEvent,DamageBlockEvent) โ none of them fire for these interactions
I saw a WorldGuard-style approach that overrides simulateInteractWithBlock() and calls interactionManager.cancelChains(chain) from inside the interaction class itself โ but how can I do this from a separate plugin without modifying the original interaction classes?
Is there any way to:
- Register a custom
IInteractionSimulationHandlerthat can block interactions? - Hook into the interaction pipeline before
interactWithBlock()runs? - Override or wrap
SimpleBlockInteractionglobally? - Monitor and revert block changes after the fact?
Are you also trying the same thing as me?
I want to cancel the area break.
from harvesting tools? yes same
Quick_Farming_by_Krynnx-1.4.1?
I've also used other languages quite extensively and at least it's not Python or smth lol. I went most of my life using mostly Python and now it's so painfully vague about everything its horrible. JS is also bad but TS cures it so hey ho
exactly
What have you achieved so far?
here this
Ah, the pain of not using a good language. My deepest sympathies.
github . com/Buuz135/SimpleClaims/blob/main/src/main/java/com/buuz135/simpleclaims/interactions/ClaimUseBlockInteraction.java
if you look at this. it should be similar but for some reason it does not trigger the interaction system
Does that system work?
I havent tried. but i expect it to work , its a somewhat popular plugin (62k downloads)
and in theory i understand why it should work. but it doesnt. i am not even trying tocancel the chain. just get notified about it
funny guess, have you forgot to set the dependencies in your manifest?
"Dependencies": {
"Hytale:EntityModule": "*",
"Hytale:InteractionModule": "*"
}
I'll study, and if I find anything out, I'll let you know.
didyou set the dependencies?
plugin manager?
in manifest
yes
@low mortar are you familiar with custom components on blocks? I tried making a tile enitity like block with a custom component that ticks and has an inventory. But I couldnt get the inventory to open properly. And when trying to copy the chest and add the custom component there the block was no longer ticking. I think something similar was discussed here previously. (maybe a bug?)
Do you maybe know how to achieve this? e.g. ticking block with custom component that also behaves like a machine /chest with inventory that you can open
found it ๐ in hytalemodding dot dev, block component page. it mentions that sorts out some loading order. worth a short.
yeah i know that page but i dont quite see how that helps with like "listeners". or the interaction systems. But "interactionmodule" sounds like a good thing todepend on
this did not help
Anyone here good with custom HUDs?
I haven't tried it, but I would assume you just add the Container entry to the items json. if that doesn't work I dunno.
what you need
I think custom components get cleard then for some reason
Im failing to understand how I can dynamically add labels to a hud
Im trying to add a list of labels
Here this was the thread. apperantly it breaks the ticking
what you using to add it right now? you can add a group in .ui #LabelContainer or what you want to name it and append your label with a label and update the hud
Ya but how do I append a label? ive tried using appendInline and its just throwing an error
Also even if I hardcode the labels they are all in the same spot one ontop of eachother
builder.append("#MyHud #LabelContainer", "MyLabel1", "Label")
.set("#MyLabel1.Text", "Hello World!");
not %100 sure about the "("#MyHud #LabelContainer", "MyLabel1", "Label")" this part but this should work
is layoutmode top
Its Left
can you try adding anchor to it .set("#MyLabel1.Anchor", "(Height: 20, Bottom: 0)"); not sure how the heights gets added but it should move the label
Hey, does anyone know why they did not add debug points to the jar so that we could see function comments?
right so does anyone know how to get some information to properly control setBlock?
public boolean setBlock(int x, int y, int z, int id, @Nonnull BlockType blockType, int rotation, int filler, int settings)
the blockType is actually the name ID of the block, however the int id here is somethiing else entirely. Within BlockType is this
public static final int DEBUG_MODEL_ID = 3;
public static final BlockType DEBUG_MODEL;
therefore if you enter 3 here. the block becomes the debug model and not the BlockType. Now, I'm assuming these values are assigned at runtime so HOW do I get the integer ID for a block to use setBlock?
try with int grassid = BlockType.getBlockIdOrUnknown("Soil_Grass", "grass block not found");
Does someone know the difference between store.addComponent and store.putComponent? Iโm a bit unsure why these exist at all as far as I understood you should not adapt the store anyway. At least not directly but using commandBuffer
if you have a x component
if you try addcomponent x that will give a error
if you try putcomponent it gonna replace it
system.onComponentSet(ref, oldComponent, component, this, commandBuffer);
system.onComponentAdded(ref, component, this, commandBuffer);
So put is for updating a component?
that looks like it. let me see
yes
it should give id if it doesnt know the block it returns 1 for UNKOWN_ID
yup that was the trick. thank you! it would have taken me another day of scouring to try and find how to get the ID
Hello! This seems like the right place to ask this.
I've been trying to develop a plug-in for the third person camera and have been running into a couple of bugs.
I wanted to know if there were some workarounds, good ways to report the bugs, or just simply a way to directly modify core code like this.
Bugs:
-
When using the method like this sudo code: SetServerCamera(View.ThirdPerson, false, settings)
- The method ignores all settings and just applies the default third person view
-
When using the view.Custom setting, the player place/break block and f interactions are never moved from the original position the method was called.
But is it thread safe? I learned you should use the commandBuffer but for example in a ui event you only get the store can I use put in that case ?
no its not safe
but you should able to get the commandbuffer on ui event
this CustomUi stuffs is driving me nuts
offical doc of customui didnt really helped a lot if you compare to other offical ones
The offical docs are out?
dani do you know the which blog post
they said we going to give a offical doc in 2-3month
modding strategy blog post said that the source code will come a couple months after release
they didn't specify a timeline for publishing their gitbook, only "after release"
oh right damn i read that wrong i guess i was waiting for a doc like that
Do you know anything about them adding a way to change descriptions per object meaning I dont want to change the translation for a specific asset rather only for a specific object
No, but that's on the feature request trello already
amazing. Thanks ๐
trello com/c/5FFH00xK
is there a way to save world templates ?
like instances?
Also, sorry for the noobie question - where exactly is this?
Yea so for example you build a dungeon world or something and then reuse that to create newinstancens
in onEntityRemove, how can i get the world with these parameters: @Nonnull Ref ref, @Nonnull AddReason reason, @Nonnull Store store, @Nonnull CommandBuffer commandBuffer. I don't know what store type it is so i am stuck here... seems simple i know but i have been at this for hours and my brain is fried
This board is maintained by Kaupenjoe, the Hytale Modding Ambassador. He is responsible for collecting and organizing our feedback and requests in regards to modding tools and APIs
In handle ui Event ? How ?
is it a chunk store?
Awesome cool. Where can I see said board?
Did the link not work when adding the dot? Here is the direct one: trello com/b/BrIJDc31
oh lol my bad ๐ thanks
how you use your ui event right now
It is possible to know which player has placed a liquid and which blocks, when this liquid expands, belong to that player?
i've tried to make it cancel on worldguard and chunk claim plugin but having 2 codec with those did not work cause multiple codec overriding the other codec, so i made just one plugin to use the codec and added dependency for worldguard and chunkclaim to cancel both of them
Is there agood way to test if my plugin is heavy or not?
put it on a weight scale
Already did that
hehe not sure how to check if plugins are heavy loaded or not
Anyone got recommendations for fixing server lag? I'm hosting on Bisect, only play with 4 players max, and have 8GB of RAM. I also updated the Performance Saver mod to the latest version, but didn't change anything in the config. I don't seem to have any issues personally, but my friends are saying they are getting bad lag spikes even when alone on the server.
commandBuffer.getExternalData().getWorld() should do the trick?
perfect thank you
any method to delete last message by player from chat ?
anyone know how to get the SwitchActiveSlotEvent??
I cant figure out how to listen to the event its a cancellable Esc event
Nope
you need to to build an EventSystem for that. public class YourSystemName extends EntityEventSystem<EntityStore, SwitchActiveSlotEvent> and then override the handle(...) method.
See hytalemodding,dev/ en/docs/guides/ecs/systems
anyone know how I can get NPCEntity component from the world entity list?
if(currentEntity.getClass().getSimpleName() =="Player"){
System.out.println("IS PLAYER");
}else{
System.out.println("NOT PLAYER");
NPCEntity npcComponent = worldy.getEntityStore().getStore().getComponent(currentEntity.getReference(), NPCEntity.getComponentType());
String npcName = NPCPlugin.get().getName(npcComponent.getRoleIndex());
System.out.println(npcName);
}```
This is failing for me so far
What am i doing wrong here. Whjen i use this:
WorldTimeResource wrt = world.getEntityStore().getStore().getResource(WorldTimeResource.getResourceType());
Instant until = wrt.getGameTime().plus(5, ChronoUnit.SECONDS);
I get the following error:
[2026/02/09 00:16:38 SEVERE] [BlockTick|P] Failed to pre-tick chunk: com.hypixel.hytale.server.core.universe.world.chunk.BlockChunk@754ef6dd
java.lang.NullPointerException: Cannot read field "requestedGameTime" because "t" is null
at com.hypixel.hytale.server.core.universe.world.chunk.section.BlockSection.lambda$static$0(BlockSection.java:1059)
at java.base/java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:473)
at it.unimi.dsi.fastutil.objects.ObjectHeaps.downHeap(ObjectHeaps.java:57)
at it.unimi.dsi.fastutil.objects.ObjectHeapPriorityQueue.dequeue(ObjectHeapPriorityQueue.java:180)
at com.hypixel.hytale.server.core.universe.world.chunk.section.BlockSection.preTick(BlockSection.java:542)
at com.hypixel.hytale.server.core.universe.world.chunk.BlockChunk.preTick(BlockChunk.java:463)
at com.hypixel.hytale.builtin.blocktick.system.ChunkBlockTickSystem$PreTick.tick(ChunkBlockTickSystem.java:47)
at com.hypixel.hytale.component.system.tick.EntityTickingSystem.doTick(EntityTickingSystem.java:92)
at com.hypixel.hytale.component.system.tick.EntityTickingSystem.tick(EntityTickingSystem.java:36)
at com.hypixel.hytale.component.Store.tick(Store.java:1974)
at com.hypixel.hytale.component.system.tick.ArchetypeTickingSystem.tick(ArchetypeTickingSystem.java:36)
at com.hypixel.hytale.component.Store.tickInternal(Store.java:1930)
at com.hypixel.hytale.component.Store.tick(Store.java:1900)
at com.hypixel.hytale.server.core.universe.world.World.tick(World.java:413)
at com.hypixel.hytale.server.core.util.thread.TickingThread.run(TickingThread.java:89)
at java.base/java.lang.Thread.run(Thread.java:1474)
oh thanks!
i tried hgoing for the packets and checking if its hotbar switch but
the crazy part is that when i do this im actually executing code that happens before the slot switched and the code im reunning gets the users held item...
So now im getting the item before the witch and not the one he switched to
Anyone know how to convert/cast an entity to NPCentity?
in the event data there is SwitchActiveSlotEvent evt; evt.newSlot . This is the new slot. Maybe that helps. If you want to execute code after the event, you can use commandBuffer.run(entityStore -> { /* your code here */});
NPCEntity is a component IIRC.
what does the commandBuffer.rn do ?
also. i dont have that Object
take a look at the decompiled code and you know ๐
It will queue the execution to run in a different thread. Not exactly sure when, but usually after the event has been fired
In your callback from the EntityEventSystem<EntityStore, SwitchActiveSlotEvent> the commandBuffer is passed as parameter:
public void handle(int i, ArchetypeChunk<EntityStore> archetypeChunk, Store<EntityStore> store, CommandBuffer<EntityStore> commandBuffer, SwitchActiveSlotEvent evt)
That makes sense, how can I access the components? I see .getComponent doesn't seem to work on any of the classes
commandBuffer.getComponent(Ref, ComponentType)
Something like that. I don't remember the exact syntax, but @fringe herald looks like they probably would.
you should use the ECS api for that. So try to get components from the EntityStore or ChunkStore. store.getComponent(ref, NPCEntity.getComponentType()) should do the trick?
That's what I had and it seems to crash the server... Strange.
Try using the command buffer instead of the store.
NPCEntity npcComponent = worldy.getEntityStore().getStore().getComponent(currentEntity.getReference(), NPCEntity.getComponentType());
have you checked the server logs to analyze the crash?
Yeah the Entity Store is crash prone due to threading stuff IIRC, that's why CommandBuffer is provided.
Yeah, it's a quiet crash, the console just ends. Is there somewhere I can get better loggin in IntelliJ?
i'd check the server logs in the appData folder under saves/YourWorld/logs/
commandBuffer.getComponent(currentEntity.getReference(), NPCEntity.getComponentType());
Try that.
This is not being triggered when changing hotbar slot
Its actually for the second hand slot area
where you can put torches
is there a way to check if a player is mounted on something?
im running into an issue where if handleDataEvent in the custompageUI is called at the same frame that sendUpdate is called, the handleDataEvent never occurs. Has anyone else ran into this issue?
Does anyone know of any open-source project/mod that uses instances with a specific goal involved, or something like a wave-based dungeon instance?
anyone has any clue how i can force an npc to go to a target location? i found several options in the server code but the behaviour tree seems to overwrite it everytime
There is the go to stored position action.
thanks any idea where in the server code i can look into it?
Hmm, in corecomponents folders of the npcs folder.
How do i get load order to work correctly? I added it to my optional dependencies as its not needed but it keeps loading before the plugin it needs?
"OptionalDependencies": {
"Jemsire:JemPlaceholders": "*"
},
Hey im looking for help with hosting my hytale server. Anyone know about it?
wondering how i get a hosting license for it
The server license for each account is free and just requires auth for up to 100 servers.
You just need to spin one up and type /auth
im trying to launch one and im getting a 403 error forbidden when starting it up
Oh for auth your getting a 403 forbidden?
Hmm, I don't understand why that would be given you are going through Oauth, and that is a directly link to your account given your signing in.
Should just allow you right in! Unless your using incorrect credentials there is nothing I know or can do to help ya.
Should be "start server: -> Type "/auth device" or something close to that, can't remember ever word -> Click on link provided -> Sign in
okay ill ahve to do some more research. im running it off of pterodactyl in my home lab but it doesnt hive much debug other than 403 error forbbiden
Oh wait, your not running the server but rather DOWNLOADING from the downloader?
it auths me than tells me 403 which is indicating licensing issue
no i am running the server just in a manager
game manager
Right but is it actually running the server, or JUST the downloader. and the downloader failed for me 100% of the time
get the egg, install it - spin up the server. then follow the /auth devic command
this is what ive done
if the egg isn't installing, that's a different issue
I had to upload my own local server.jar and Assets.zip
its installed
i tried but the assets folder was too large
Hmm. Do you see those two files in your file menu? - Or what do you see? I am thinking you had my exact problem.
No matter what I did and tried, I could not for some reason be authenticated by their auth server to get the CLI tool to download the server files.
you shouldn't need to move anything over manually. the egg installs it for you.
Yes, but when it doesn't authenticate you it wont. Hytales servers never allowed me past no matter what and how many times I tried.
yea this was a step AI got me to try
you don't need auth to download it. just to run it.
like, you're not even prompted with auth until after the downloader has ran
what gives you 403.
Their server manual explicitly states the downloader prompts for auth. - It returns 403 forbidden for me as well.
[Pterodactyl Daemon]: Finished pulling Docker container image
Checking for Hytale server update...
2026/02/09 03:51:52 error fetching manifest: could not get signed URL for manifest: could not get signed URL: HTTP status: 403 Forbidden
your server needs a FQDN
that error is a security error, but not because you're not logged in
because the server doing the request has bad ssl or is missing a fqdn
This would usually result in a could not resolve host issue., ssl would be a certificate/handshake error. - I believe the unsigned URL is due to an auth issue specifically.
403 is a return code, meaning full connection was met just isn't allowed.
Hey is there a way to actually make this work i want to make it so it gives the item that the block gives when it breaks is there a way to repair this?
if (itemAsset != null) {
ItemStack drop = new ItemStack(itemAsset.getId(), 1);
player.getInventory()
.getCombinedHotbarFirst()
.addItemStack(drop);```
Is this the egg your using?
ghcr () io/pterodactyl/games:hytale
I solved it by creating a predefined docker image for the server files and when I run I just authorize it.
I can also automate the CLI with my tool chain, but as far as I know that egg is broken, but can be bypassed but still requires the server.jar and assets.zip
has anyone noticed that blocks placed in creative mode when broken it will also drop the block item itself?
why is that
So is a World just a separate instance running on the same server? Like when you teleport to the first quest area? Or I suppose the dungeons that are still under construction?
yes
Thanks, just wanted to make sure my mind was thinking right. lol.
they run on their own thread too so if you want to do something like spawn an item you need to do world.execute(() -> { });
Where are the interaction translations located in the assets?
Yeah, I'm hitting the exact same roadblocks as you. Everything with controlling entities becomes imposbile once you start tring to access it via a timer.
I have a strange feeling this might just be the way the code works and we might have to find workarounds for anything timer based... Maybe the command system will be able to do some of the things we can't do in Java easily.
hi everyone,
im having a lot of trouble playing with friends. We have tried hamachi, enable firewall, aternos, and we cant play together. always someone have a troble ยฟany solution? Thx btw
anyone know where the BlockType JSON assets are stored? I'm trying to figure out how to edit them when plugin is loaded
Do you mean BlockType.getAssetMap() or Server/Item/Items?
hey thx for reply man, I think I just figured it out. I'm gonna try to edit it in the LoadedAssetsEvent and change some stuff
if Server/Languages/<langcode>/servers lang
search for
interactionHints
or
interactions
For the texts
in the items json file you would have something like
"InteractionHint": "server.interactionHints.open",
to specifiy what string it should use.
Hello, can someone tell me how I can get access to the types of my costume components in an interaction?
How to fix connecting to a server using via-code, hamachi, joining public servers: failed to connect any avaliable adress the hosy may be offline or behint a strick firewall, An unexpected error occurred
that's not really a thing you fix with code, sounds like you have a network issue
Sometimes I can connect to public servers, sometimes I can't. I think I have a stable network and I don't have this problem, but I just don't understand how to fix it.
I tried with the firewall, with time synchronization, with the IPv4 setting in the network settings and nothing
I start my testing by adding a custom interaction in a custom plugin, using one of the existing as reference how to set it up.
The base interaction class seem to give access to a couple of different entities, so trough that you should be able to get the actual player interacting with the target item.
Use the proper store quering for the component types of your costume based on the player info, and do what ever logic you need to do if you find any components of the type.
Would be my guess at least not having the ability to try right now.
The Interaction should then be added to the interaction chain of the type you want to extend at a proper place based on if it should be able to cancel the original interactions or not from what i've understood, but I don't have the insight into have the interaction chain is populated. So this could be the wrong way to go.
If you just want to catch that the interaction happened and do something, I think you could listen for a event instead, then from the event see if you have access to player causing it and can get the components from the store based on that, and do what you need to do, but not sure if thats the right way either.
Not sure if this has been asked before but is persistance added so every time i fire up server i dont have to auth?
yeah
just use encryped so there is less risk of username/password leaking. Otherwise it will be stored in plain text from what i understand it.
I have it currently set as encryped but everytime server is restarted i have to /auth login again
Could be that you don't have the permissions to create the file where it needs to be stored.
Or if you are running in somekind of vm environment that only hold states in memory until closed.
its running on Pterodactyl
Hi. I want to ask if there's any preferred way to have per world mods on a server?
I found a mod that seems to do this, but it has a very few downloads so I am not sure I trust it.
Did you mount /etc/machine-id? What's the error message?
Or alternatively, a way to disable specific mods in specific worlds
is there a player falling event?
What's the way to query the environment for blocks or components? For example, how does the bench recognizes all nearby inventories?
root@controlpanel:~# /etc/machine-id
-bash: /etc/machine-id: Permission denied
Sorry not 100% sure what you mean?
/etc/machine-id is a file with a unique id for your server. Hytale uses this to encrypt your session tokens. That's why it needs access to it in the pterodactyl container
it's a text file, not an executable
just mount it into the container
Hello everyone, Iโd like to ask if youโre still experiencing the Forgotten Temple issue when exiting the area. Is it still the same problem? Iโm using the Discord Game Server.
ummm Dam beyond my knowledge ๐ and my Linux Tech guy away for a few weeks dammit
Thankyou for trying to help though
You can just update wings to v1.12.1
then it does it automatically for you
wings is only showing 1.12 where do i find 1.12.1?
github com/pterodactyl/wings/releases/tag/v1.12.1
quick question, is it possible to build a server plugin that includes a data asset pack that can be viewed in the asset editor, or are the included assets in the resources folder just not visible in the asset editor?
I guess this boils down to, if I want to edit some aspects of my server plugin in the asset editor, do I have to make a second mod for the asset pack?
You essentially answer your own question.
Take a look at getContainersAroundBench( ... ) in the servers CraftingManager.java in hypxl/hytale/builtin/crafting/component/
Yes, asset packs that are included inside of a plugin are visible in the asset editor. However, in production they are read-only since they are zipped up. During development, you can leave them unzipped and sync them back and forth. There is a gradle task example for this here: github com/Kaupenjoe/Hytale-Example-Plugin/blob/main/build.gradle.kts#L96
As for querying the chunks for blocks there should be other examples in the code that does that.
But the majority of cases it is getting access to the world object, and then ask the world for the store of the thing you are looking for, or in a system you could set it up to give you the store for the components you are interested at, at the get go. Depends a bit on where and when you need to access them.
nice, that kind of also answers a follow-up question for me ๐
Why some items in hand don't trigger secondary interaction on blocks?
have you looked at the item.json if they have the same intereactions?
i have Secondary interaction on my custome block to read item in hand and add it to filter list. But some items like Life Essence / metal bars dont trigger any interaction when i click on my block
ah, thx! searched through differen files, but couldn't find this method, exactly what I look for, thx
my only problem is, right now I don't see any asset packs in the editor, and can't find a newly created item I have as a json file in the resources/Server/Item/... folder, but I can spawn it so it's definitely there. I set the "IncludesAssetPack" to true in the config. Is there anything else I have to configure so it shows up? I'm using the idea hytale plugin project template. Maybe some build configuration stuff? I'm sadly a bit unfamiliar with the java ecosystem
You don't see your plugin's asset pack in the drop down menu in the top left of the asset editor?
Nope, only Hytale:Hytale
The items/tools declare the interactions a object can do either themselves or in the parent json.
The block only declare what it should react on, not what interactions should be possible.
i think...
oh, do I have to set a specific server version in the manifest? I'm currently on pre-release * also, is there something like "latest" or "any" I can use so I don't get the warning?
so i need to add Event for right click to read all secondary actions
Either that, or find some other way to trigger it.
Like see if its possible to add some kind of default interaction event or input event if non exist for an item.
Anything that is not a tool or consumable item probably won't do a interaction as default
will try this after work ๐ thx
it might have to do something with the version I'm using.. I've just tried building against the latest release jar and launched hytale on the release branch and the asset pack shows up now, but only in "read-only" - which I think is fine because it's a server plugin?
I think I solved it. The server can be run with a --mods argument which should point to the plugin source, where the resource folder with the data assets json files is. I think this also makes a gradle task that syncs the files back after stopping the dev server unnecessary
That could sound resonable. Also nice to keep assets in a different depth at times, or if you are multiple people limit the risk that you change break something someone else is working on at the moment, due to source control stuff.
is there anyways to change player movement speed?
There is a MovementManager that reads MovementSettings. I bet one of those settings control the players movement speed.
yeah looking at the parameters there you see there are for instance BackwardRunSpeedMultiplier
if you then use a tool to search trough the json files in the assets
then you see that server/entity/MovementConfig/Default.json sets that value.
so by altering those defaults in the json you could probably control all different movement values you might need.
Oh, that reminds me: @fathom dune is there a way to get all the asset json files instead of overriding them one by one?
oh, dang! it's the Assets.zip, isn't it?
I have absolutly no idea. Sorry.
Most of my replies so far have been by analyzing the server java and json files, based on the question and previous modding experience.
I haven't even had the time to work on something on my own, and i am at work so i can't put to much time into each thing. :S
But wait.
It is possible to block commands from other plugins?
For one of my systems I could only find an EntityTickingSystem as a solution. How could I check the impact of it running all the time?
you could make a template and state that its a parent to the current item or maybe even to the template object, depending on how they designed it.
Then it would atleast pull the same values into every object. but that would still require a change to each file.
probably via permissions
With something like Spark?
I think they have metric tools in the code base that you could use to track or debug impacts of things but i haven't looked at those.
which spark?
spark,lucko,me
ah, that looks good, thx
Did anyone test server performance? How much ram it will require to support like 64players(32vs32). Is it possible to not let some chunks be loaded?(For a minigame)
If it becomes a problem you could add your own timer that only excutes when it ran for X time or X ticks, decreasing constant updates if need be if there is no other way.
sure you would still run the base update but you would atleast filter away your own logic to the duration it would actually need.
My problem is that I want to do something in the next server tick, so I hold a queue of tasks and in the next server tick they get evaluated. But it seems that an empty queue is really negligible in my impl
Yeah. People really sweet to much over things being just updated. It's rarely the big impact if the updates does essentially no work.
It never comes close to multilayered updates of the same items or large performance impact logic in itself.
I try to work with block states without using BlockState as it is marked as deprecated, feels really wonky rn
BlockStates are being deprecated in favor of block components, Component<ChunkStore>
โค๏ธ
yeah I know, I use that. But converting a component on a block to the item stack and vice versa seems not so easy
Dani might have seen me rage during the weekend in another channel about objects not being Component enough, so this makes me glad.
I handle my own block breaking and block placing to update the components/metadata
from reading the decompiled server jar, I saw that the old BlockState is handled everywhere for block placing and destroying but this is lost when using item stack metadata and block components
Anyone know a mod that adds a custom sized world border and not just a square or circle ?
There is always an issue of knowing what level to break down the components too.
The extremist case is that every value type should be a component, and thats a bit to far.
But I do not like components having lots of logic in them, that could have been in a system instead. ๐
In my case I made it now that my custom block does not drop anything, then in handle the block break event and figure out if the broken block is mine. If so, I add an generate the drop with the relevant component data into the metadata of the itemstack
feels like a lot of work just to keep state around
Can totally be the case that components are not 100% feature complete yet and some things can only be done with blockstate for now. I'm not too knowledgeable in that area
It feels like it, but having components on blocks feels like the right choice
@teal briar
I would like to create a crafting system that works on a material component level, rather than defined items.
It would require a lower level declaration of material properties. But it would increase the crafting freedom a infinite amount.
Yeah?
owner plotplus?
Wdym
?
I dont know what you mean
Thank you, it worked perfectly!
I think he wonders if you are the creator of plotplus.
hey, how can I get the player as the Player object in an event like PlayerDisconnectEvent that only give you the PlayerRef ? it's for accessing their inventory
can you use event.getPlayer() ?
no not on this event
If there is a disconnect the ordinary player object probably doesn't exist anymore. Since they disconnected, You would probably have to look up how the Player usually read and write to its inventory and replicate that somehow without the player object.
wasn't there a guid connecting the player account to the player data so it could be recreated on the next connect?
I remember someone talking about it a few days ago
here is what someone mentioned above to get the player from a playerref.
There is a guide for how to make a plugin in hytale?
sounds cool but where do you keep the finer details? In the item, then you would have override like every item. It might be nicer if you have a table or some heuristic how youl could derive these details from other values on items
maybe like this?
var playerRef = event.getPlayerRef();
var ref = playerRef.getReference();
var store = ref.getStore();
var player = store.getComponent(ref, Player.getComponentType());
ah yes, but the Player is deleted before the event so it's unusable is there a way to retrieve a player's data ?
not really sure sorry
You will need to use the uuid from the playerref, and via codec or other solution read the player inventory from the file its stored in. (the file name is just the players "{uuid}.json" i think)
then save it again when you've done your changes.
There i LivingEntity codec you could try to make a version of that would just read the player information and the inventory i guess, that might help.
I haven't worked enough with codecs yet to be sure.
huh, maybe that could be done using interactions ๐ค
This is probs not it, but maybe instead of an Event, maybe use RefSystem, query for the player component, and use the onComponentRemoved hook
Yeah. Events i would leave to things that needs to react to what happened to something that is not the object itself.
Outward communication not internal.
Missed your reply, this would probably be its own system ignoring hytales old crafting and items and just use this for new and radically different things.
I mean, where do you want to store your item details?
Yeah probably in the new item type, aggregated from the relevant properties from the crafting components.
Try getting the offline player from storage?
Universe.get().getPlayerStorage().load(playerRef.getUUID())
Makes sense there was a existing way to do it.
Woaw you can really just do that ?
yeah why not? lol
I will try when I get home
Idk I just didnโt used Universe much
only a bit awkward to use because it returns a CompletableFuture
since it's an IO operation
But you just have to await that right or do you have to do a async callback?
both are valid
I am java rusty, so wasn't sure the terms where the same, but thats good.
I should take a look trough what stores there are, because that would probably be 99% access to things.
Is there a way to have something like getComponentAt(Vector3i targetPos, ComponentType<ChunkStore, Component<ChunkStore>>)?
It seems for it to be usable from within systems, it needs to be thread-safe and therefore use a CommandBuffer<ChunkStore>
I also found that some nice methods are hidden in other classes. for example BreakBlockUtils or BlockModule are somewhere deep in the trees but have very nice methods
Yeah util classes are always a good idea to look at. Also if there are any kind of ????Helper class.
I love that Hytale is so moddable
It has potential.
The interesting part will be to see if servers start to create larger plugin packs a partials of mods and you start to get a unique verions of things.
ChunkUtil has a ton of helper methods for block/chunk positions and dealing with the hierarchy. TargetUtil has all the raycast methods and helpers for spatial queries
SpaceStation 14 got the issue that public servers cross copied items, but people didn't have the energy to create the components in code, so they dropped features like crazy.
And then conflicting identical system, like a full detailed body/organs for simulating damage, one body part system for visuals, and one for actual body parts that where loose in the world, that did not interact in any of the others.
One server added customizable armor from another, but they didn't have the energy for the custom parts, so that they removed that part of it, and just made every unique variant of optional modules you could attach its own fully craftable item.
So instead of one armor with 20 components, you got a list of 20 armors with almost identical names. ๐
i added Signature Charges and Signature Energy to my weapon but it wont generate any signature energy, anyone know smth about it?
Is their anything for more mobs and higher difficulty?
I'm trying to reference UI/ItemQualities/Slots/SlotDefault@2x.png in my .ui page but it doesnt show up? anyone know why?
Would anyone happen to know how to overwrite the name of a vanilla block in a mod using the server.lang file?
I'm trying to rename "Green Cloth" to "Dark Green Cloth" using this: "items.Cloth_Block_Wool_Green.name = Dark Green Cloth" line in my modded server.lang file. I have also properly overwritten the original block in the asset editor. Have reloaded the world and the name of the block is unchanged.
Hello guys, do you recommend any mods to improve server performance?
how can I adapt this
ParticleUtil.spawnParticleEffect(
"ManaRegenParticles",
playerPos,
commandBuffer
);
to take in a specific color as well?
I know you can be far more indepth with the command, but I'd like to keep it as short and sweet as possible, just adding a color to this
if (manaIsRegenerating) {
ParticleUtil.spawnParticleEffect(
"ManaRegenParticles",
playerPos,
commandBuffer
);
}
if (lifeIsRegenerating) {
ParticleUtil.spawnParticleEffect(
"QiRegenParticles",
playerPos.x,
playerPos.y,
playerPos.z,
0f, 0f, 0f,
1f,
new com.hypixel.hytale.protocol.Color((byte)80, (byte)200, (byte)120), // Jade Green #50C878
null,
objectList,
store
);
}
if (soulIsRegenerating) {
ParticleUtil.spawnParticleEffect(
"SoulRegenParticles",
playerPos.x,
playerPos.y,
playerPos.z,
0f, 0f, 0f,
1f,
new com.hypixel.hytale.protocol.Color((byte)180, (byte)140, (byte)255), // Soft Purple #B48CFF
null,
objectList,
store
);
}
if (spiritIsRegenerating) {
ParticleUtil.spawnParticleEffect(
"SpiritRegenParticles",
playerPos.x,
playerPos.y,
playerPos.z,
0f, 0f, 0f,
1f,
new com.hypixel.hytale.protocol.Color((byte)240, (byte)248, (byte)255), // Alice Blue / Silver #F0F8FF
null,
objectList,
store
);
}
I find the mana regeneration one far cleaner than the others, so I'd like to use that one instead, but I can't find a way to add a color to that one
or would it be better to use an effectcontroller?
If its the function signature that annoys you, why don't register your own util function with the parameters you need just like util does?
well, it seems that either function requires wildly different parameters, which massively changes what I need to send in
As i said, if you look in the actual util function they all end up calling the same function internally.
So adding a static class ParticleUtilExt{ ... with a function that takes a the parameters you want should be easy.
I did not look into interactions previously but that might be it. I can define an interaction that places the block, then modify the components and then remove the item from my inventory. This way suddenly I only need to code updating the block with the component data. The rest can be done entirely through assets
Is there an equivalent to Bukkit.dispatchCommand()?
Hi, does anyone here know how to create an asset programmatically? Specifically, I want to create an image (png, Texture) using a mod depending on a command.
Mabye CommandManager.get().handleCommand(PlayerRef, String)?
Thank you in advance
And thank you twice if it works
how does one reallocate alot of memory?
In Java? I don't even dare to consider it.
yeah
Im using ItemGridSlot in my page.ui file but the items original tooltip stays of i close the page while hovering, does anyone know why?
im on windows and trying to start my server up but it says i need more memory
[2026/02/09 15:39:53 SEVERE] [SERR] Reallocate: 131072 to 1179648 thats what it says
Figured this out, was pretty obvious in hindsight. In case anyone else wants to do the same: You have to change the translation ID in the overwrite to a new value, like "X_Rename" and use that value in the server.lang file.
InstancePlugin.get().spawnInstance(...).thenCompose(world -> {
ChunkLightingManager manager = world.getChunkLighting();
LightCalculation calc = manager.getLightCalculation();
manager.setLightCalculation(new FullBrightLightCalculation(manager, calc));
});
I'm trying to set the lighting of a new instance, this doesn't work. I also can't seem to get the command in game to work either. I don't understand lighting :/ anyone got any tips on forced lighting?
how can i get the item dropped of a block? is there something like this?
world.getBlock(bx, by, bz).getDropId()
i feel like i need to live and breath the server code to understand how to do the simplest of things. I guess it doesn't help that it is early access so its very much a prototype product in itself
There are limitations like i'm pretty sure there is a bug with tilled soil decaying into dry dirt because even in vanilla, it only updates when there is a block update, so i can't figure out a way to make it update consistently, even with a scheduled tick which i also found can break the ticking sometimes when using WorldResources to retrieve the time
okay so it works but i can't find out how to get the Component out of this, like getting any values from it
how do u ppl go around detecting main block of multiblock models? lets say that furnace is 2x2 and pos of bottom right block hold state. if u query any other part of this multi block and check state it returns null
Look at the code in BlockHarvestUtils. Some blocks have a drop list instead of dropping a single item
I couldnโt figure it out how to use it in an event handler, cus of all the references is there a way to do itv
I don't have a simple example. The general flow would be to:
Get the block type string
Use the BlockType asset map to get the block config
Check if the config has a drop list
If yes use ItemModule.getRandomItemDrops() to get the drops
If no then the item ID is the only drop
i'm working on a public permissions plugin rn this is all the planned features so far is there anything im missing feature wise? or any ideas you guys have
Extensive in-game Control Panel
Create unlimited groups
Per user permissions
Per group permissions
Per user prefixes and suffixes
Per group prefixes and suffixes
Per server groups & permissions
Per world groups & permissions
Multiple prefixes/suffixes ordered by weight (Example: [A] [Member] Player)
Discord bot hooking (Discord roles syncing)
MySQL, Redis, MongoDB, SQLite, JSON & YML storage options.
Multi server sync using Redis.
-# (You can use Redis for both persistent storage and syncing or you can use another storage method with using Redis for syncing.)
Automatic backups to Locally, FTP/SFTP, Google Drive, Dropbox, MEGA or OneDrive.
Can you show that around a player? I want to make a passive ability that will ddo something like that
Why not use HyperPerms or LuckPerms? both are wildly feature robust and successful
somebody know if on assets editor i can override multiple items at the same time? or need to do one by one
one by one unless something channged
No real reason tbh I'm making my own simply because I want to, it'll be a public feature rich competitor, I've also been hearing a lot of complaints about bugs with luckperms specifically, i haven't heard much about hyperperms tbh I didn't even know it existed until recently and I have a statistics plugin I want to implement into the plugin (similar to plugin metrics or bstats) I want to track how many servers use my plugin and how many players interacted with them i think it'll be cool to see those statistics
help guys, ive just add some permission to default group in permission.json, but after server restart or player join, the permission is gone from the list of default group, do anyone know why like this?
Majority of bugs with LuckPerms is usage/integration from other plugins IMO but yah
I get what you mean btw, I'm producing an MMORPG plugin and there's heavy competition but I have a vision and know its different
Hey, anyone know if its possible to take an existing entityEffect and copy the object so that I can alter it then delete it without changing the initial entityEffect?
does anyone know how to get rid if item info displays? cus when im hovering an item and close the custom ui the tooltip info of the item doesnt dissapear and it feels like ive tried everything
you can, yeah, you just need to spawn every tick
I have a question, using PlayerRef, does the uuid of a player change everytime he logs on and off ?
Iโm going for a fully GUI based permissions system. You can still use commands if you want, but the GUI will be way easier. With Hytaleโs GUI tools, it should feel really intuitive. The plugin will pull a list of permissions from all the plugins you have installed, so adding a permission to a group or a user is as simple as picking one from the list and clicking a few buttons. You can choose things like whether the permission is blocked and what scope it applies to, such as global, server, or world. You can also manually add any permissions that arenโt available or couldnโt be pulled automatically.
Hi, does anyone know how to show custom text on the item on hover? ( in the UI )
That's the best part. You don't.
The uuid should be consistant I am sure, since thats whats used to look up the players inventory when they log back in.
so it's not possible?
Right now, unfortunately no,
yikes
Ya ui is pretty limited rn
You can change the hover text of a type of item, not a specific instance of an item. You can cheat it a little bit by sending fake asset update packets to a specific player
see #1467918520456183949 in the hytalemodding,dev discord
ah will take a look, tnx!
seem like a lot of work for changing the description though haha
hey, did you manages to make an npc go to a specific location ? I'm struggling to make my npc follow a path, it always stop after move 10 blocks away..
Yeah, an improvement for this is already on the feature request board: trello com/c/5FFH00xK
hmmm, neato
Anyone know how I can change the height at which a player jumps?
Hey, for a plugin idea, I need the frame buffer of the current frame from the player's view/perspective (basically a screenshot). This information might not be available to a server plugin because the client renders everything locally. Since I don't want to discard this idea, I'm currently looking for suitable solutions. Can anyone help me with this or have any ideas where i should take a look at? If it doesn't violate the TOS, I would also be willing to write a hook/modification for the client to get this frame buffer or the screenshot file.
I've already tried using the Machinima camera for this, but it doesn't seem to have any frame buffer data.
check how sethbling made a camera with minecraft command blocks 10 years ago :P
Yes, i looked at that, but i dont think reconstructing the scene/view is the way to go for this plugin. Thanks for the reply anyway.
is there a way i could send u my code and just help me out looking why it doesnt work cus im trying to do it and im struggling a lot
so i have a custom component on my block. I want to modify the data for a block in a different execution loop (when the player interacts with the block using a custom trigger)
How would i access and modify a component's data for a block?
Are there MovementManagers for separate entities? Could this change the speed of a single unique entity dynamically?
I am not sure. Differen attacks and abilities seem to influence the value.
Post it here and @ me, I'll be able to take a closer look in a few hours
If it's too long then you can D M me
Not being able to say D M here at all is ridiculous
I used naturallyremoveblock cuus idk why it didnt work with destroy blocks and this was the only think i could figure out but idk if this is even how it works
AssetMap gathering = assetMap.getAssetMap().get("Gathering");
if (gathering.getAssetMap().containsKey("Breaking")) {
AssetMap breaking = gathering.getAssetMap().get("Breaking");
if (breaking.getAssetMap().containsKey("DropList")) {
dropListId = breaking.getAssetMap().get("DropList").toString();
}
}
}
BlockHarvestUtils.naturallyRemoveBlock(
new Vector3i(bx, by, bz),
blockType,
0,
1,
blockType.getId(),
dropListId,
0,
chunkRef,
world.getEntityStore().getStore(),
world.getChunkStore().getStore()
);```
I guess I should ask what the end goal is here
oh yep i want to make a sort of bomb, where u destroy the bomb and the 3x3x3 blocks around this bomb destroy too i did it already with the destroyblocks func but it doesnt drop items idk why
How do I change the duration of nights vs. days? Our server is noticing that nights are lasting longer somehow.
If anyone is interested in ordering a mod, DmmM me.
how can i read if the player is attacking?
!kiss Hytale
Has anyone used the OpenCustomUIInteraction class and registered interactions with it ? I'm trying to do my first NPC interactions, but I'm not finding any infos on it
There's an ExplosionUtils class you might want to look at
Need ability to work with item tooltips. RN tooltips based on item desctiptions, and Item itself. But ItemStack can contain custom Metatada what we want to display (e.g. custom tags, modifiers, etc.). Want some API what allow us to modify tooltips (or populate it) with data, without making custom UI.
I'm currently developing an approach that creates virtual Item_IDs so you can modify Item tooltip/name dynamically per item without loosing compatibility with some systems that check for Item_IDs
It's far from finished and I have to test it thoroughly, but if it works I'll make a guide on how to implement it
Thanks!
When it comes to updating a mod to the "current version" of Hytale, what must one change? I assume it's manifest related but not sure.
is there a generator type like Void without the fog and skybox glitch?
it should mainly being used to build isolated arenas
so i dont need to generat chunks instead just build the arena there
There's a hacking campaign targeting hytale accounts. I urge everyone to verify their account information and ensure that the authentication app is enabled.
unless there was a change to the code that alters something related to your mod/plugin all you really need to do is update the server jar in your libraries then re build
This is just some textures and json files. It works fine, but just wanted to stop the warning messages about it targetting an older server version.
Custom components with a CODEC are supposed to persist right? Is there something special you need to do to save them?
i tried it for the current pre-release version and still get the error and i dont know why. It Worked all the time until now. Can there be a differend problem?
my component is not saving for some reason. `public class PlayerData implements Component<EntityStore>
{
public static ComponentType<EntityStore, PlayerData> component;
public int State;
public String Sss;
public static final BuilderCodec<PlayerData> CODEC = BuilderCodec.builder(PlayerData.class, PlayerData::new)
.append(
new KeyedCodec<Integer>("State", Codec.INTEGER),
(data, value) -> data.State = value,
(data) -> data.State
)
.add()
.append(
new KeyedCodec<String>("Sss", Codec.STRING),
(data, value) -> data.Sss = value,
(data) -> data.Sss
)
.add()
.build();
public PlayerData()
{
}
@Nullable
@Override
public Component<EntityStore> clone() {
return new PlayerData();
}
}`
Ah I think I figure it out. When I register the component I have to include the CODEC, PlayerData.component = getEntityStoreRegistry().registerComponent(PlayerData.class,"PlayerData", PlayerData.CODEC);
Hello, All, Just wondering if anyone has found a way to implement additional character slots in the left panel of the inventory screen? for example a slot for a jet pack or a third party backpack?
Or are the API's not yet exposing that?
That's all clientside unfortunately.
Really? They baked that in?
Y, as of now. You can find it in the Client/Data/Interface/InGame/Inventory folder.
Interesting and thats not modifiable via the server UI stuff?
That is incredibly disappointing, I hope that adjust this as being able to add things to character sheet is kind of important. Thanks for the reply
what about a way to use a custom HUD and make it accessible when the inventory is open? making it so you could drag items into "Slots" there? Or are custom HUD elements inaccessible when the inventory screen is open ( like a modal?)
Huds are not interactable
Also, can confirm inventory related things are hardcoded
The whole UI system is trash atm tbh
Your best shot is to recreate the inventory page (which is a ton of work) on the server side, and then cancel the opening of the default one, but there are missing components that are only available on the client so good luck with that.
Well you can interact with a hud by getting click events through interactions (for example, move the position of a hardcoded element when clicking), but you can't attach those events directly to a specific hud element.
Could be a nice workaround, but the inventory also uses a PageOverlay which probably hides the hud element
has anyone been able to rig a block with a custom use event that opens the user's inventory?
That was something I was considering, another option I was thinking was a / command to open a "Inventory" and some how trying to use that as a Pho baubles type system. thanks all.
S
Hello, good morning, I would like help about a server that I want to do but in a vps Linux ubuntu that the server does not appear
You can copy and paste the existing .ui file for the inventory from the client as a basis, but the actual code for handling stuff, yeah, that's from scratch.
sadly its still not just "copy-pasting" but I get what you mean. 
help guys, ive just add some permission to default group in permission.json, but after server restart or player join, the permission is gone from the list of default group, do anyone know why like this?
@late breach Hey friend, how's it going? I'm having a lag problem on the Hytale server and there are a few things I'd like to know what Hytale is using so I can optimize it as much as possible. Some KD Tree is at 97% usage, could you help me? I promise I won't take up too much of your time!
@Simon @crimson beacon @Connor @empty island
My server is the largest Hytale server in Brazil, but I'm having this constant lag problem. I believe it's due to the number of players, but knowing that information would help. I have the Spark log and a screenshot showing what KDtree is using.
Hello someone please help me before i die of frustration. I am trying to guide a NPC to go to a specific custom block. I have been trying for so long that i am now on my last resort so im here for some coding genius to save me. Does anyone have any idea what apis they'd use to make this happen. I've looked at the NPC guide on the dev website and just cant seem to get mine to do what i want.
I want a zombie npc to spawn and seek a specific block like its their only goal in life. For some reason it just wont f'in work ive tried so many solutions but just want to see how someone else would approach it before i give more context to see if im going crazy and if i approached it the wrong way
Any 1 knows how to create a world from a template?
wtm by from a template
hey... i believe this is a good channel to ask this. im on linux and my friend is on windows, what file paths do i need to follow to view the world files on linux? if this isnt the correct channel let me know what is
you mean like this ? Hytale\UserData\Saves\CanyonTest\universe\worlds\default
yeah kinda like that.
i dont see the problem there
im just trying to find the world pathing since every time i open the world file through the main menu it fails to find the pathing but it can still open the uorld
open hytale launcher in top left here settings icon press that open hytale file location with open directory button then im not %100 sure but linux should be same userdata>saves>worldname>universe>worlds
aaaahhhhh its just the main menue that isnt working for me
you mean the button gets you wrong place? in-game when you inside world settings world file button?
nother question, will the charecter data be saved for the world? or if people have played on said world loose all of their stuff?
nah, when i try to open the world pathing from the world menu it crashes
do you get crash log
yeah, just when i try to follow the pathing that it gives me for the crash the pathing doesnt exist
https://accounts.hytale.com/feedback you could submit a bug report what os you have and crash log etc
in future updates they problaby can fix it if they see it
How are you supposed to truly change the nameplate color of an opposing enemy player? is this doable yet?
Iโm making a mod with a custom UI page (InteractiveCustomUIPage) like /prices. How do I do multiple pages / pagination (Next/Prev) in the UI? Like click a button and it shows page 2 / page 3. Whatโs the normal way people do pages in mods? I have a button THAT closes the UI but also ESC works, I cant send or show files if needed im just super lost.. anytime i come to UI I end up into more errors then actually building the damn Mod.. is there a easy way to do UI?
check out the modding docs, its pretty simple
Yeah I have been.
its only thing i use and the Sources it gives trouble dev the githubs youtube videos.
i Even am using staff from another server i play on which is actually helping a lot
place a button somewhere use eventdata save your pagenumber close your page open your new page every page different eventdata 1th page goes 2th 2th can go 3th and 1th
when i try eventdata and using Codecs it gives me red errors and underlines that wont let me compile in the end, Can you explain more?
cant really but i can give you few working .addEventBinding( examples
that would be PERFECT! i appreciate that a lot
Like lets say i have Dungeon_1 But i want the same dungeon but multiple instances. That would mean i need to create first the World Template like the actual world and the ncreate instances for that world no ?
Anyone knows why after I override an item it works perfectly until I refresh the server? All the changes are unmade after I rejoin and it's frustrating :/
your dungeon that what? prefab or just folder?
there exist InstancesPlugin which can create worlds from .bson files(template)
but idk how create these .bson files. Maybe exist special util, I couldn't find
Yea thats what is confusing me too. I thought maybe i can just use a world folder and create instances of that world or something
Also couldnt find .bson informations
anyone got .addEventBinding( examples I keep tryna use som but maven/intellij is reading it as Errors, How do you apply UICommandBuilder updates after a button click in this build?
Do they use:
sendUpdate() only?
sendUpdate(builder)?
openCustomPage(...)?
What event binding type they use for buttons:
Activated
Activating
something else?
hi
how do u add buttons in the chat?
like [Vote] or something like that
Isn't there a difference between the files in the project and files read by the project in runtime? If you are changing the wrong one it is replacing the runtime files with the dev files you are supposed to change.
Like if you are changing the files in build/resource rather than src/resources
Making a custom UI thats gonna have a non-set number / set value amount of buttons on it, each button would set that players like prefix ingame.
Basically I'm looking at programmatically creating UI elements and adding them to a parent in java
Have anyone experience issues if they say reach 12+ players block delays start kicking in, even though I have 8 CPU Cores running at 200 out 800 % and 32GB memory which only uses about 12GB at the time it starts to get noticeable lag/delays, under 10 players I have no issues with block delays and lag, so just find it so odd what it could be.
I think it could be your network being too slow
seemingly the game has some issues with packets as even on my localhost server I have packet issues and am marked as bad connectivity, so I'm guessing that your network or PC fails to send out enough information at the right speeds
nothing about the network, I've now been with 4 different host all the same, even networks with 1Gbps upload/download in Datacenters
Hi, does anyone know of a mod option where the whole world is protected and only becomes buildable via a claim?
This channels for discussion about making plugins not plugins themselves try the discussion channel?
Oh sry my bad
All g
i hope hytale adjusts the placement limit on teleporters. bypassing it using mods can be really stressful sometimes because of the heavy load
do any one have server i can play hytale and not be stuck in a lobby or cant hit and pick up stuff
Message.raw("[Vote]").link("vote.domain.com");
Having issues with .ui files? Players fail to load because of customui
@UseButtonStyle = TextButtonStyle(
Default: (Background: #8b3a3a, LabelStyle: (FontSize: 11, TextColor: #ffffff, RenderBold: true, HorizontalAlignment: Center, VerticalAlignment: Center)),
Hovered: (Background: #9b4a4a, LabelStyle: (FontSize: 11, TextColor: #ffffff, RenderBold: true, HorizontalAlignment: Center, VerticalAlignment: Center)),
Pressed: (Background: #7b2a2a, LabelStyle: (FontSize: 11, TextColor: #ffffff, RenderBold: true, HorizontalAlignment: Center, VerticalAlignment: Center))
);
Group {
LayoutMode: Center;
Anchor: (Height: 30);
Background: #1a2433(0.8);
TextButton #UseButton {
Text: "PLACEHOLDER";
Style: @UseButtonStyle;
}
}
$C = "../Common.ui";
Group {
Anchor: (Width: 400, Height: 200);
Background: #1a1a2e(0.95);
LayoutMode: Vertical;
Padding: (Full: 20);
Label {
Text: "Prefixes";
}
Group {
LayoutMode: TopScroll;
Group {
LayoutMode: Middle;
Group #Prefix1 {
LayoutMode: Vertical;
Padding: (Full: 5);
}
Group #Prefix2 {
LayoutMode: Vertical;
Padding: (Full: 5);
}
Group #Prefix3 {
LayoutMode: Vertical;
Padding: (Full: 5);
}
}
}
}
are you certain that LayoutMode: Vertical exists?
Checked docs, you're right dont know what I didnt pick up on that thank you, -- its "Top"
I have a plugin called SimpleColor that adds all the typical color codes from minecraft along with support for hex codes, gradients (with unlimited colors + a built in rainbow code), links, formatting codes (bold, italic, underline & monospace) also a lot of developer tools e.g.
player.sendMessage(Message.raw(CC.GREEN + "Success!"));
player.sendMessage(Message.raw(CC.RED + "Error!"));
// Legacy codes
player.sendMessage(CC.translate("&aGreen &cRed &eYellow"));
// Hex colors
player.sendMessage(CC.translate("&#FF5733Orange �FFFFCyan"));
// Gradients
player.sendMessage(CC.translate("&#FF0000:0000FFRed to blue"));
// Rainbow
player.sendMessage(CC.translate("&*Rainbow text!"));
// Links
player.sendMessage(CC.translate("&(https://example.com)[Click!]"));
// Combined
player.sendMessage(CC.translate(
"&aSuccess! &7Visit &(https://example.com)[our site]"
));
also does the client produce any error log you can look at? It's usually the quickest way to track down where an error is in the future.
I know that servers do atleast but havent seen anything for clients
windows: %APPDATA%\Hytale\UserData\logs
mac: ~/Library/Application Support/Hytale/UserData/Logs
Not saying it would log it, or know if it would log it well, but I hope it logs error properly. ๐
Did you try looking at %APPDATA%/Hytale/UserData/Logs for the client logs?
If you like mini-messages and kyori, I recommend this: github#com/SuperCrafting/Hytale-Component ;)
is there any update on breeding in the future? dont wanna risk having to put a breeding mod when hytale releases that feature
Or just use TinyMsg which is supported by the unofficial mod docs
I think they mentioned they want to fix more around animal keeping in general. But no idea when it will happen.
yeah real i need it bad
Yes, what I am proposing is mini message support with an additional monospace tag
TinyMessage does not have all of kyori's tags
Or maybe added them since then?
I have only copied a npc so far, not even started debugging.
When i do first step is adding a custom block, spawn the npc and just make it path find to it as one of its states.
Should be semi trivial I hope. Since there is already pathfinding to a location.
badly need this hahaha
crude arrows are the only arrows for now am right?
obtainable in survival? yes, but there are some additional types which you can get in creative
how about in terms of compatibility and functionality? tried some bows, some are not loading the arrows in
...
as far as I remember all vanilla bows should be usable, but some of the effects designated to certain bows could be not implemented yet
this is noted thank you for answering my clarification!
2 days and ive finally planned out my permissions plugin i'll be making over the next 2 weeks super feature rich should out perform the current top competitors ๐
is there a way to display player avatar in UI is there some event or thing which takes it
Do items held in hand have meta data or some other way of storage? Can they have components?
I'd like to make a tool that stores information on them, i.e a ruler that keeps track of the where the measurement started or in which mode it is
It should reference the same entity or entityid no matter if you have it in your hand or not, and being an entity it should have components.
Hey is there any info or date for when provider accounts will again be validated/granted?
I tried to emailing the studio or find any possible info, but no way to reach them.
Excuse me, but I am a bit confused. I bought the Cursebreaker edition of the game, yet I do not seem to be in the Cursebreaker category.
What steps do I need to take to fix that?
https://support.hytale.com is the best way to reach them
@west elk Thank you.
how do you I access those entities? Until now, for me items were just ItemStacks in an ItemContainer, so very generic and nothing with a place to store cusotm data
OH do you just mean discord? Do you have access to the cursebreaker cosmetics in-game but only the discord role is missing?
Correct
Then you just need to go to https://accounts.hytale.com/settings and disconnect and reconnect discord
That's what I am figuring out as well. My assumption is, to make it more generic, that all items are a itemstack. Just that some itemstacks are limited to a size of 1.
The stackitem holds an item ID.
So i assume you would get the unique entity from the stack item, by requesting its entity and or components for the entitystore or componentstore.
@west elk That fixed it. Thank you for your assistance.
No. That was a stupid assumption of me, the itemid is just the defined type it is.
Found it. There's the concept of "meta data" for item stacks, which is a simple data container (BSON). You can fill the meta data via itemStack.withMetadata(..) and read values from it via itemStack.getFromMetadataOrDefault(..).
Anytime the ItemStack is moved or copied, the metadata will follow.
This should do the trick, trying it out now
yeah. I saw that but could not find a good reference to where the metadata was used, but if you can save and store it, it doesn't really matter.
see UseCaptureCrateInteraction.java
It boils down to those 3 lines of code where they capture the NPC in the item and remove the NPC entity from the world :
inventory.getHotbar().replaceItemStackInSlot(activeHotbarSlot, item, itemWithNPC);
commandBuffer.removeEntity(targetEntity, RemoveReason.REMOVE);```
Yeah and
CapturedNPCMetadata meta = inHandItemStack.getFromMetadataOrDefault("CapturedEntity", CapturedNPCMetadata.CODEC);
as an example for how to read the specific object, and for what type from the itemStacks metadata.
I'm getting weird Couldn't resolve relative path: ../Common.ui in my MyPage.ui for some reason. I've placed ui file inside resources.Common.UI.Custom, in MyPage component I've did uiCommandBuilder.append("MyPage.ui") and for some reason it fails
have you written Common.ui anywhere in your files?
nah
According to the docs:
The Common.ui file is at
Common/UI/Custom/Common.uiwithin the Hytale pack.
So if your MyPage.ui is in the same place in the folder structure, you don't need the path traversal up
hello, I'm trying serialize/deserialize an ItemContainer, but whatever I try I can't figure out how to get a functional ItemContainer to use on a player after deserializing it always returns null with my current code:
public static byte[] serializeContainer(ItemContainer container) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(baos);
int size = container.getCapacity();
out.writeInt(size);
for (int i = 0; i < size; i++) {
ItemStack stack = container.getItemStack((short) i);
if (stack == null || stack.isEmpty()) {
out.writeBoolean(false);
continue;
}
out.writeBoolean(true);
out.writeUTF(stack.getItem().getId());
out.writeInt(stack.getQuantity());
}
out.close();
return baos.toByteArray();
}
public static ItemContainer deserializeContainer(byte[] data) throws IOException {
if (data == null || data.length == 0) {
return null;
}
DataInputStream in = new DataInputStream(new ByteArrayInputStream(data));
int size = in.readInt();
if (size <= 0) {
return null;
}
ItemContainer container = new SimpleItemContainer((short) size);
for (int i = 0; i < size; i++) {
boolean hasItem = in.readBoolean();
if (!hasItem) {
continue;
}
String itemId = in.readUTF();
int amount = in.readInt();
container.setItemStackForSlot((short) i, new ItemStack(itemId, amount));
}
return container;
}
Why are you not using the codec for that?
ItemContainer.CODEC.encode, ItemContainer.CODEC.decode
What are you trying to do with it?
Storing it in database
Check out com.hypixel.hytale.server.core.universe.playerdata.DiskPlayerStorageProvider
it's responsible for storing player data as json files
how can i use that
like that ? new DiskPlayerStorageProvider().getPlayerStorage().load(playerRef.getUuid())
no
it's just an example of how to use the codec to turn an object into a BsonDocument and back
since you asked for an implementation example
oh okay
if you want to load and store players themselves, you can create your own PlayerStorageProvider and tell the hytale server to use that instead of the DiskPlayerStorageProvider
they made it modular for exactly this reason
but I thought you only wanted to store individual items in your db
well if I can store the players directly and load them back up on every log in, it may be better
ok yeah this is exactly what it's intended for then ๐
you'll want to implement PlayerStorageProvider and implement your database logic there
okay I see but it only have a getPlayerStorage, how do i save a player ?
null by default, the function return PlayerStorage
So, look at the PlayerStorage interface
oh okay my bad
it has the save(), load(), remove() functions
for the default implementation, it's an inner static class of DiskPlayerStorageProvider
so in my class that implement PlayerStorageProvider I can use load() to get the data so I can save it in the db and then later I can take that data and use save() ?
you are confusing the PlayerStorage and PlayerStorageProvider
though i guess there is nothing preventing you from implementing both interfaces in one class
for some reason wasn't working either. Fetched new template from github, moved all the configuration and it works now despite having the same structure. I blame windows trickery for that
yeah, I don't quite understand how it works is there no docs on that ?
no, but you can decompile the server to see the source code for reference
So I've got like general question - how do you go about creating mods? I mean like how do you know certain stuff exists in the code and what they actually mean? Like it's just trial and error using certain functions, search for something that contains any word that's connected for what we're building? I have no experience in modding either hytale or minecraft, so far was doing some custom UI and basic camera settings changes
Yes, for me it's a lot of reading the Hytale source code to learn how and where things are implemented and using that for reference. For example for bloup's question above, I knew that the hytale server config.json has this configuration:
"PlayerStorage": {
"Type": "Hytale"
},
then, i searched for PlayerStorage in the source code and found files like PlayerStorageProvider.java, and DiskPlayerStorageProvider.java. Reading them confirmed that this is the logic required for saving and storing player data in .json files on disk.
Now you can go up the chain to see how these classes are instantiated, how the PlayerStorage is being configured and how to tell the server to use your custom implementation
If you are just getting started with modding, I can highly recommend video guides by TroubleDEV and Kaupenjoe on youtube. They give you a great overview of what programming concepts are relevant and how Hytale applies them.
yeah, I've been following both of them, also going through hytalemodding and hytale-docs. I understand core basics like inheritance, methods, types, overloading, some basic functions of Java (although I'm only node.js+ts developer) so trying to find a way around all of this stuff
For me, I usually try learning a new thing by reading the documentation and especially examples, copying code snippets, modifying them until I have a grasp on the thing I'm learning, then I try small things from scratch and if I'm still motivated, larger things ๐
TroubleDEV on youtube has a few videos about the server architecture and ECS which helps with the theory a bit
oh nvm, you guys just wrote about that
recently I've been looking inside other mods, how people are building them, what they're using in their functionalities
Yeees source code is always the best way to learn for me as well
also found kaupenjoe's repo with gradle tasks to run debug server, helps a bit with testing stuff as I don't have to rerun the server all the time, but in terms of UI unfortunately it seems that I have to reset it anyway to apply changes
both hytale source code (majority of it is made up of plugins as well) and community plugins
some of you probably are way more familiar with java than I, so I was wondering if java devs actually have to create setters and getters each time as I've seen in the source? Isn't there anything like C#'s automatic properties or a short hand syntax?
I just make everything public, lol
It's more important when you expect others to use your plugin as an api. But when you just write code for yourself, you can take some "shortcuts"
No, Java has a bad convention of doing that. Don't do it, the function calls of getters and setters is unironically extra cpu cycles for no reason if you have both a standard getter and setter.
There are records, which have field getters by default iirc.
nah if they're trivial getter and setters, the compiler will optimize them away. Don't try to outsmart the compiler
The alternative is lombok, which generates getters and setters for you based on annotations
It's OOP brain rot. Waste of everyone's time and code.
Or the ultimate solution, kotlin.
Yeah do it for readability and ease of use. Not for imagined performance reasons
yaeh, saw lombok being an alternative, just have to add it to your pom or graddle, intellij plugin and simply decorate with @Data and import to file
hahaha I hit a nerve, it's all good though, thanks for the info ๐
As someone who has used languages with public members, this is not real.
Getters and setters logically make sense if you stop thinking about the now and think how it might be refactored later. The only downside is having to do it manually, which is a solved problem
That's what everyone who overengineers/overabstrcacts says.
There are Records, which look like:
public record Effect(int range, String flavor) { }
These auto generate getters, constructors, equals and hashCode statements, but no setters because they are read only.
And that's what everyone who hasn't worked on a production-level repo says.
also if you don't want to type it manually and you're using intellij then you have alt+insert to open menu and automatically create getter and setter
And? Production repos are famous for having those issues.
That makes sense, in C# theres records too, they're nifty
As much as they are "issues" for those who can't take on a little bit of code bloat, they were developed out of necessity - they solve specific problems, which don't always have cleaner solutions.
also some more cpu cycles can sometimes be sacrificed for ease of use or future extension, if speed isn't the issue
There were also talks about carrier classes for non-immutable, record-style classes, but I don't think there's a JEP for that yet
That might make things better
I would expect that is part of project valhalla, right?
think I'll probably use records for immutable data objects and classes for services / logic then. What's a JEP?
Such as the refactoring everyone plans for that doesn't happen?
I don't think so, valhalla is quite unrelated to what this is
I guess it wouldn't have to be a value class
hey man, it's great for iterative or agile development where you as a developer already have a good feeling that things will change, but the refactoring that never comes is also a real thing ๐
They do happen quite infrequently, true, but it also saves a lot of hassle when it happens. Again, the issue isn't the concept of getters and setters, it's that you have to manually do it in java.
Ok, yeah if stuck in the horrible system of Agile perhaps.
It's what you make of it :p
A JEP is a JDK Enhancement Proposal, and is how features get added to Java.
I can't quite summarize it as it's been a while since I watched it, but it's from Inside Java Newscast #105 if you want to watch
Cheers
You would spend less time only making them when you needed them than preparing everything to handle them though.
Which is why kotlin is such a lifesaver
You get them automatically generated, and you can refactor quite easily by adding a getter or setter method manually on the field
Also if the refactor changes behaviour behind the scenes then the public api not changing might be irrelevant because it was using it with respect to how it was doing stuff.
Like C#'s public vars with inline getters and setters?
There is also Lombok I guess, which generates getters and setters from annotations.
Lombok has some issues though
Basically, yeah, but without even the { get; set; }. Opting out is done via an annotation instead - @tender gullField (which exposes the backing field itself)
entire library to replace alt + insert :sip:
An entire library + IDE plugins, yeah ๐
Fields are basically this: ```kt
val name: Type
You can specify getters like this: ```kt
val name: Type
get() = otherField.type
``` - but the getter is still there even without the explicit declaration
... In fairness, anyone who uses C# inline getters and setters as just { get; set; } w\o custom logic deserves to be shot.
But... Why not just only make them when you need them.
That's exactly it, you only make them when you need them. They are auto-generated accessors otherwise
On the JVM it still does .getName() to access that field
...
So it's impossible to have a public var?
You can opt out with @JvmField
Also, there are some situations where there are no getters generated iirc
Kotlin sounds more OOP than Java.
It is an OOP language ๐คทโโ๏ธ
small violin
Sadness.
more small violin
Apparently it's not generated for const variables and private fields
Well, it can't have made inheritance any worse.
Obviously, if you have a getter for a const, you're just sadistic.
Now a setter for a const, that's different.
Yeah, then you're a sociopath
Ugh, I don't know enough about js to make a joke about the js const keyword, but I know one would fit here. Just pretend I did.
JS is worse than Brain#### and Malbolge.
NaNNaNNaNNaNNaNNaNNaNaBATMAN
Brainf*ck is a great language actually, but perhaps we're going a bit too off-topic
Brain#### computer hytale mod.
I do like the idea behind it, thought a variation of it would be great for a genetics system.
I miss being able to assign keybinds to the โtickโ functions of the systems, that is, the typical conditional that you can do in all graphics engines of โif <key> is pressed {do something}โ. From what I've seen, you can't do that yet. Is that right?
You can through interactions I think. Depends on what you mean.
I mean literally executing code by pressing a specific key. Is that currently possible?
Kind of? You can intercept existing keys, but not custom ones.
There are no custom keybinds for the game, however, you can hijack the regular interaction keys like F or Alt through the packets, though
hi all if anyone wonder how to create json "pretty"
public Gson getGson() {
return new GsonBuilder().setPrettyPrinting().create();
}
try (var writer = getFileWriter("mods/YourMod/config.json")) {
getGson().toJson(new YourModConfig(ObjectValue, OtherValues), writer);
} catch (IOException e) {
throw new RuntimeException(e);
}
it looked messy with just new Gson, with the "new GsonBuilder" can make it "pretty"
Couldnt you do this with any moderation mod and console..
How can I generate a prefab in an instance based on condition X, and also generate a block (like a chest) based on condition Y? Is it possible to use prefab spawner blocks and block spawners conditionally?
I have the same mod tbh.. so I know what you are doing lol but my web panel is not compulsory
Yeah people are always going to be paranoid about any external third party pulling and pushing data to their servers no matter the context.
Its a public mod, I havent opened the web panel yet but its something thats basically done
One of the bigger things is, my mod has server as authoritative and has a service provider which only takes action based on authenticated tasks
I assume you use rest API or is it a websocket?
Its called ModerationPlus on curseforge
I would love to see your mod as well if I can check it out
That doesn't address the concerns. If the panel isn't part of the plugin (or at the very least self-hostable), it's a Backdoor-as-a-Service
How well protected is the rest service you have made?
What if I get a bot to send 10k requests a min
hey, how to make a GUI ?
There are official docs for the .ui files at
hytalemodding dev/en/docs/official-documentation/custom-ui
BTW ducky dont take it personally, I am just asking cause I wanna know how you are doing it ๐
Since we are in "similar" field
i'll be honest
"We use a websocket to send data to our server"
is a very hard pass for me
but nontheless best of luck with your project
not only a possible security issue
but also means: your server goes down, i have a problem
but i'm hosting on a root server which is capable of hosting its own webpanels, so there is also no need for this beeing external sourced
still means i loose my panel access
and still: i don't see a benefit of this beeing outsourced instead of self hosted
I am just not seeing the value of it, compared to having my own. The size where this would be required is not close to being in scope, since i am not runing company, handling hosting of multiple servers.
Does anyone know what code handles tree felling/batch breaking of blocks?
And that is for me personally.
No its probably useful at some point for people, just personaly i see no need, and i think most people will have no need for quite a while with rapid updates and changes. When the plugins grow larger, and distinct implementations happen for separate servers, seeing running plugins and issues in a central place might be good in those cases.
well as i said: best uf luck to your project
and i'm sure then not your target (;
also sounds like monthly costs (;
My old pc had like a 16gb Single stick ram, i5 6500, 1060 gpu, is that even worth making into a hytale server? My current pc easily Handles both my hytale Client and server on localhost
Current pc is 64gb ram, 7900xtx, 7800x3d
should do well as long as it runs as a dedicated server i feel like, specially if you run some slimmed down OS and not much else it shouldn't be an issue "i think"
Worth a shot. Make use of old hardware while not spending money on cloud. Use to run mc server for small 12 person smp on a ryzen 3900x so anything can work as long as you work with it.
anyone got .addEventBinding( examples I keep tryna use some but maven/intellij is reading it as Errors, How do you apply UICommandBuilder updates after a button click in this build? going off WIKI its giving me RED Errors which will not allow me to package.. using maven Itellj and the wiki but always running into UI problems.
Do they use:
sendUpdate() only?
sendUpdate(builder)?
openCustomPage(...)?
What event binding type they use for buttons:
Activated
Activating
something else?
The harder questions is if your computer are exposed to the internet trough your ISP, and routers so it will be accessible remotely. Thats what i often find is the issue when running servers.
best is probably use the "decompile server" button and search for addEventBinding in the actual code, that would be the best examples.
do people make nick with upper and lower case, like 2 peoples with Mike and other acc mike ?
What does it look like rn.
My Ui or Java class?
Java Class
Does anyone know of any good towny plugins? I've tried Towny3D but it's very buggy
do you want The whole class imports n all?? or do u want where it keeps messing me up?
is there any performance plugins/software for hytale servers?
There are quite a lot of them, but 99% are just System.gc() slop
Nitrado's one seems to have had the most thought going into it
Yeah I got that wrong, the resource from the game will overwrite the ones in the project folder, since you can create and modify things trough the ingame tools. Not sure why i assume the inverse.
how can I get a ComponentAccessor<EntityStore> from a TickableBlockState? the Tick function gives me a ComponentAccessor<ChunkStore>
how would you go about preventing builder tools from placing/breaking blocks
the ComponentAccessor is the Store
oh my bad, i misunderstood. world.getEntityStore()
Well, that's an EntityStore, not a ComponentAccessor<EntityStore>, I'm trying to
TargetUtil.getAllEntitiesInSphere(vector3d, 5, commandBuffer.getExternalData().getWorld().getEntityStore());
I need a commandbuffer for EntityStore, but I have a commandbuffer for Chunkstore, and I wonder if I can go from one to the other
EntityStore.getStore()
public class Store<ECS_TYPE> implements ComponentAccessor<ECS_TYPE> {
ah, that works, thank you :)
there's the BlockBreakEvent and BlockPlaceEvent but they seem to be for singular blocks
is there a way to get like selection bounds
Item metadata is just arbitrary data you can add to an item, it doesn't influence anything on the client. Dynamic tooltips aren't currently possible.
Hello, I've just started getting interested in creating mods for Hytale. I wanted to start with a simple player list, but when I try to customize the interface further, I feel limited by the game; simply adding a BackgroundColor to a label causes the plugin to crash.
Hi, I'm looking for a mod or plugin that has a command to set the player respawn point.
BackgroundColor is not a valid property name. It's just Background in Hytale's custom UI markup langauge.
Check the official docs here: hytalemodding dev/en/docs/official-documentation/custom-ui
How can I retrieve the mobs that are spawned in my instance so I can track them by ID? How do I create a counter for mobs X and Y? I need a code example via a plugin.
The best way is to do your logic from within one of the entity systems, you can use the query to fine tune which entities it gets applied to.
Alternatively, you could do something like world.getEntityStore().getStore().forEachEntityParallel(query, (archetype, commandBuffer) -> {}).
whats the best way to share code between plugins ?
dependencies
you can make a "library plugin" that contains only your shared logic and have your other plugins depend on it in your manifest.json
So i create another plugin with only the library and use the jar file
in my other plugins is that how it works?
yes. make sure to not bundle that library into the other plugins though
Interesting thanks!
You can look into how it works for minecraft plugins. there is more documentation for it and the concepts are the same. You only need to mentally replace plugin.yml (spigot) with manifest.json (hytale)
Btw how do i apply custom components to a world? How do i get the ref to a world?= I already managed to add custom components to player but i need the ref to the world to do the same for the world. How would i get that?
If you mean block components, those are Component<ChunkStore> and Ref<ChunkStore>
no i mean actual custom component like custom data attached to the world
You would probably use a Resource for that instead of a component
why is that?
Components are attached to a specific entity, not the world itself
Resources are attached to a world
Or more specifically a store
oh ok, how would i do that? what exactly is a resource?
Take a look at ChunkUnloadingSystem. It uses a resource to keep track of a global timer
It's also perfectly valid to store global data completely outside of ECS. Each plugin gets a data folder you can use for anything.
oh do i create that folder ?
My use case is overly complex so it's probably not a great example, but this class loads data on demand and saves it back when the server shuts down: github com/elijahlorden/HyCompumancy/blob/main/src/main/java/me/freznel/compumancy/vm/store/InvocationStore.java
It gets created automatically if you save a config file into it via Plugin.withConfig(codec).save(). If you want to save custom files, you probably have to create it with Files.createDirectories(Plugin.dataDirectory) or similar
Im a bit confused so this is not the store for the world itself? var worldEntityStore = world.getEntityStore();
var worldStore = worldEntityStore.getStore();
It is
it's where components for entities are stored
but be aware that components for blocks are stored in the ChunkStore instead
Ok but the world itself is not an entity which means if i would like to attach custom data to a world its just via resources or custom data file?
sadge i hoped there was a way to attach components to the world
What kind of data do you want to attach to the world?
I have a command /leave hideout but i only want that command to work if the player is inside a specific type of world
i hoped i could pass like tags or something to the world but couldnt find a way
i wanted to pass information the world at creation time so i can check if it is that type of world
Hm I use the world name to determine what it's used for in my plugin
Resources are the ECS way of doing this. Instances use InstanceDataResource to store instance data
Hello everyone! I just want to create a mob counter for an instance. It would work like this: Generate the instance with some NPCs using prefabs. I want to count the number of NPCs of a certain type in the instance, for example: 2x Skeleton_Minion, 3x Skeleton_Knight. Someone can help me?
InstanceWorldConfig instanceConfig = InstanceWorldConfig.ensureAndGet(worldConfig);
Like this? But how do i access or create the resource for that? instance
Resources are registered to EntityStore or ChunkStore in your plugin class just like components. Registration returns a resource type which you should store in your plugin singleton. You use store.getResource() with the resource type to get a registered resource
do you have a resource i could take a look at? Or an example maybe?
Nice, a world's current time is a resource like this. Check the TimeResource
Thanks!
So Basically i need to create a resource like that and then i have to add the resource to my plugin? And inside the resource how to i differentiate between for example for which world the resource is or how do i add the resource? ( Do I create one resource for one world or do i create one resource for all worlds ? )
Sorry for so many question im new to hytale modding and java itself so there are a few concepts that im not quite sure about
Exactly. Check TimeModule to see where it's registered.
You get a resource from a store. Stores are already per-world.
you can copy and unpack the zip in the client somewhere for exampels on how the tcurrent game resources look.
ParticleSystem.getAssetMap().getAssetMap()
For sounds, I'm not sure. Maybe SoundSet?
Resources don't know which store they're attached to, just like components don't know which entity they're attached to
@fathom dune @west elk thanks! that map getter is look good for dummy data thanks
Riiiight, java have nothing like var or auto, right, you allways have explicitly declare the type?
what does "REMINDER: staged update waiting to be applied" mean, after I updated my Server? (I already solved it)
Since Java 10 (8 years ago), you can use var to declare variables which will infer the type
I solved the problem
Ah. Since its a generic i have to specify the type for it to know what its supposed to be.
Oh type erasure, how we all hate you.
Did you find a solution to this?
Any words from the devs on when the docs & source code will be released?
I'm accepting orders for Mods/Plugins, if you're interested, D. .M me.
I've started on my own docs check my bio if you find it useful please star the repo
if you find any issues create an issue if you want to fix it or add to the docs create a pull request
Any official docs yet?
Not a modder and i dont have a programing expiriance xD so basacly idiot playing the game. Anyone can help me by answering few questions about modding? Its in regards to making world restrictions what can and cant player do
not yet unfortunately i think me (check my bio) and hytalemodding have the best current docs my docs are more code driven they have a lot more user friendliness but less examples and actual code
We have official docs for NPCs, Custom UI, and Worldgen
wait fr?
when? and where?
yeah: hytalemodding dev/en/docs/official-documentation/custom-ui
oh :V not really official but cosigned by simon
Can we whitelist some domains on this discord ? Surprised hytale domains arenโt allowed here
Makes it really hard to reference hytale docs
hytalemodding,dev isn't a hytale domain, it's a community-maintained project. But the Hypixel team have shared some of their internal docs that have been incorporated there.
Oh I know. I mean any domain used for support purposes
the npc docs for example were shared as a pdf
Like why block it is my question
i mean hytale.com domains are whitelisted
but yeah maybe they can set up a redirect service for small things like the official docs on hytalemodding
so sick that they're providing official documentation finally but they need to put it on the actual hytale site ngl they 100% need to make a javadocs page that would be so helpful for a lot of people
javadocs will come with the source code release
i havent kept up with the recent updates but im wondering when that will actually happen
i'm just getting caught up with the current changes
They haven't said anything to contradict what they said in the Modding Strategy blog post
We commit to releasing the server source code as soon as we are legally able to. Expect this within 1-2 months after release.
CC @jade rose
oh okay sick i wasn't sure if that was changed so thats actually not that far away
awesome
Thanks! ๐
i have some plans for when they release the source its gonna be sick i can't wait i really want to fork the server jar purely because how mad the PlayerChatEvent and how the message system worked
i hate the formatter system
keep in mind "shared source" does not mean "open source". We don't know what type of license they plan on using for it, but there's a chance it might restrict reuse
We can only play one animation at a time right?
And blockbench doesn't allow for multiple animations baked into one either does it?
Is there any way to prevent "Invalid teleport" from crashing the client in very specific situations, such as when trying to teleport a player who has the respawn screen active?
do the TeleportSystems not handle edge cases like that?
Iโve been extremely impressed at the current state of hytale in an early release phase. Big shout out to all the developers that poured hours and hours of their sweat and tears ๐ The launched API is fantastic. Love the command system and UI
always use up to date references
is it possible to build your plugin to keep it editable from within the game? like making it a folder instead?
Don't think so, because it locks down the jar while doing that, so you can't rebuild it anyways.
i know i wouldn't make a fork and release it publicly if its not allowed by the license i'm sure they will have protections for themselves
Did you fix this?
are you having the same issue
I am, yes
never tried on huds but can you try with diagnostics mode
No idea what that is
go to settings in general bottom there diagnostics mode it can give you .ui errors or other things related to customui / hud to fix it
theres a console opens too i think you can log something to that but never saw someone use it
ohhh mb
Hi, can I check in a mod if an Asset exists (at all)? Ideally I can check if its the right type (texture, png)
i got the problem wrong i thought you making the hud and something doesnt work thats problaby you need crash log to solve it from some users
Client never crashes, server says client disconnected due to crash
Crash occurs when player enters ancient gateway, any player
so no crash log
Right
if the world crashes, the stacktrace is in the server log
World remains uncrashed
the main world or the forgotten temple world?
The server remains up with other players active
I didn't say the server crashes
Whoever enters the ancient gateway gets blackscreen, never crashes
i said the world thread crashes
in hytale, every world runs on it's own thread
so one world can crash and everything else can continue running
public boolean assetexist(String assetPath) {
AssetManager assetManager = HytaleServer.get().getAssetManager();
AssetRef assetRef = assetManager.getAsset(assetPath);
return assetRef != null;
}
boolean exists = assetexist("textures/items/sword.png");
you mean like this?
Buffer Cache Report
Total Cache Buffer Requests: 1656
Missed Cache Buffer Requests: 1656
Missed/Total Ratio: 100.0%
i think yes, thanks :D i was trying looking for something like this in AssetModule.
did i get wrong or you saying you searched wrong
I searched wrong was what I wanted to say, sorry. But for me theres no AssetManager in HytaleServer?
am using 2026.01.28-87d03be09
really? lemme check i might be gived you wrong i just copied from a project the get from but