kyazuki
Members-
Posts
113 -
Joined
-
Last visited
Everything posted by kyazuki
-
My mod add only 1 block. I want to replace all blocks which the game generates for the block.(except fluids, spawners and end portal frames) However, I don't want to override vanilla blocks. Then I hope that the game generates structures.(e.g. Stronghold) And I want to replace blocks of structures. So I think overriding biomes and structures is easier than adding biome. How do I override?
-
Thanks!! It works!!
-
Thanks! Then, how do I localize the name?
-
I think I should add NBT Tag, but I don't know how to do it.
-
(Solved)[1.15.2]Which method does the game use to choose a biome?
kyazuki replied to kyazuki's topic in Modder Support
I found the method! Thank you! -
(Solved)[1.15.2]Which method does the game use to choose a biome?
kyazuki replied to kyazuki's topic in Modder Support
Can anybody help? -
(Solved)[1.15.2]Speed.applyModifier doesn't call FOVUpdateEvent
kyazuki replied to kyazuki's topic in Modder Support
I'm such an idiot... Thank you very much! -
(Solved)[1.15.2]Speed.applyModifier doesn't call FOVUpdateEvent
kyazuki replied to kyazuki's topic in Modder Support
I wrote @Mod.EventBusSubscriber and @SubscribeEvent. Isn't it enough to register? -
I want to reset FOV when player is applied speed modifier. The Game doesn't call onFOVChange method... @SubscribeEvent public static void setSpeedPlayer(TickEvent.PlayerTickEvent event) { player_movement_speed = event.player.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED); player_movement_speed.removeModifier(/*UUID*/); player_movement_speed.applyModifier(new AttributeModifier(/*UUID*/, /*Name*/, speed - 1.0f, AttributeModifier.Operation.MULTIPLY_TOTAL)); } } @SubscribeEvent @OnlyIn(Dist.CLIENT) public void onFOVChange(FOVUpdateEvent event) { LOGGER.debug("ChangeFOV!"); if (event.getEntity() instanceof PlayerEntity) { PlayerEntity player = event.getEntity(); EffectInstance speed = player.getActivePotionEffect(Effects.SPEED); float fov = 0.9f, sprint_fov = 1.02f; if (player.isSprinting()) event.setNewfov(speed != null ? sprint_fov + ((0.104f * (speed.getAmplifier() + 1))) : sprint_fov); else event.setNewfov(speed != null ? fov + (0.08f * (speed.getAmplifier() + 1)) : fov); } }
-
The game shows my command by auto complete, so I think the game knows my command. However, system always shows "Unknown command". public class SetDistanceCommand { public static void register(CommandDispatcher<CommandSource> dispatcher) { dispatcher.register(Commands.literal("setdistance") .requires(source -> source.hasPermissionLevel(2)) .then(Commands.argument("blocks", IntegerArgumentType.integer())) .executes(context -> { context.getSource().sendFeedback(new TranslationTextComponent("commands.mymod.setdistance"), true); MyModConfig.distanceToNormal = IntegerArgumentType.getInteger(context, "blocks"); return 0; })); } }
-
I want to create an addon mod for his luckyblock mod(https://github.com/alexsocha/luckyblock). I have made a small mod, so I have some knowledge of modding. I want to call his methods in my mod.
-
I have sources of a base mod from github. Please teach me what do I need to modify. It's solved! I used JitPack.
-
Can anybody help?
-
(Solved)[1.15.2]setHealth method don't work as I expected
kyazuki replied to kyazuki's topic in Modder Support
I was mistaken about isRemote method. I reduced their max health in Render Thread( if(isRemote()) ). Thank you very much! Could you answer to this topic? -
(Solved)[1.15.2]setHealth method don't work as I expected
kyazuki replied to kyazuki's topic in Modder Support
Hmm... I can't find the method to sync. Can you tell me methods which I should check using the debugger? -
(Solved)[1.15.2]setHealth method don't work as I expected
kyazuki replied to kyazuki's topic in Modder Support
I checked by debugger. setHealth method works in Server Thread. Should I check methods in Render Thread? I don't know the method which health synced to the server. -
(Solved)[1.15.2]setHealth method don't work as I expected
kyazuki replied to kyazuki's topic in Modder Support
Sorry, I said 20 hearts as max health(include gray hearts)... -
(Solved)[1.15.2]setHealth method don't work as I expected
kyazuki replied to kyazuki's topic in Modder Support
applyModifier works, but setHealth didn't works. My mod gradually reduces the max health from 40.0 to 10.0. Then, the player whose max health is 10.0 is killed. I want to reset the player's max health to 40.0. So, I calls my method when the player dies. The method reset their max healths as I expected. However, setHealth doesn't work in the client. Health is same value before they die(ex. 10.0 / 40.0), but LOGGER says 40.0 / 40.0 in Server Thread. Client's health isn't synced to Server's health. -
(Solved)[1.15.2]setHealth method don't work as I expected
kyazuki replied to kyazuki's topic in Modder Support
I want to set max health to 40.0f as default value. So I don't use effects of potions and equipments. The game renders 20 hearts. So the client knows my modified max health, didn't it? -
Sorry, I completely thought I must call language register methods. Thank you for your help!
-
This cord set max health to 40.0f as I expected, but setHealth don't work. Logger always says "Change to: 40.0 / 40.0" only in Server Thread. I think setHealth calls only in Server Thread. How do I fix? @SubscribeEvent public static void respawnPlayer(PlayerEvent.PlayerRespawnEvent event) { player.getAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(TestMaxHealthUUID); player.getAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(new AttributeModifier(TestMaxHealthUUID, "TestMaxHealth", 2.0f - 1.0f, AttributeModifier.Operation.MULTIPLY_TOTAL)); player.setHealth(40.0f); LOGGER.debug("change to: " + player.getHealth() + " / " + player.getMaxHealth()); }
-
Thanks! Then, how do I change death messages by lang file(en_us.json)?
-
I want to show Custom DeathMessage("%playername died by malnutrition") when player dies by onDeath method. However, onDeath method always shows "%playername died." How do I change this? public static DamageSource Malnutrition = new DamageSource("Malnutrition"); @SubscribeEvent public static void killPlayer(TickEvent.PlayerTickEvent event) { if (!event.player.world.isRemote()) { if (/* check player */) { if (event.player.isAlive()) { event.player.setHealth(0.0f); event.player.onDeath(Malnutrition); } } } }
-
(Solved)[1.15.2]player.onDeath method causes crash
kyazuki replied to kyazuki's topic in Modder Support
I assume that I must call onDeath in Server Thread... Thanks!!