Jump to content

kyazuki

Members
  • Posts

    113
  • Joined

  • Last visited

Everything posted by kyazuki

  1. 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?
  2. Thanks!! It works!!
  3. Thanks! Then, how do I localize the name?
  4. I think I should add NBT Tag, but I don't know how to do it.
  5. I found the method! Thank you!
  6. I want to change conditions of choosing a biome.(e.g. Every chunk is a different biome.) Which class should I extend? And which method should I override?
  7. I'm such an idiot... Thank you very much!
  8. I wrote @Mod.EventBusSubscriber and @SubscribeEvent. Isn't it enough to register?
  9. 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); } }
  10. 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; })); } }
  11. 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.
  12. I have sources of a base mod from github. Please teach me what do I need to modify. It's solved! I used JitPack.
  13. Can anybody help?
  14. 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?
  15. Hmm... I can't find the method to sync. Can you tell me methods which I should check using the debugger?
  16. 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.
  17. Sorry, I said 20 hearts as max health(include gray hearts)...
  18. 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.
  19. 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?
  20. Sorry, I completely thought I must call language register methods. Thank you for your help!
  21. 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()); }
  22. Thanks! Then, how do I change death messages by lang file(en_us.json)?
  23. 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); } } } }
  24. I assume that I must call onDeath in Server Thread... Thanks!!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.