Everything posted by poopoodice
-
[Solved][1.16.4] How do I correctly sync capability data between Client and server?
I don't know if this is intentional but in your SkillStorage, method writeNBT you kept rewrite/override the value of "xp", "static", and "dynamic". I guess what you are trying to do here is something like: for(int i = 0; i < 26; i++) { data.putInt("xp" + i, (int) instance.getXp(i) * 10); data.putInt("static" + i, instance.getStaticLevel(i)); data.putInt("dynamic" + i, instance.getLevel(i)); } so does writeNBT(), you assign the same value to every slot or whatever it is.
-
Get rid of arrow bounce back (1.16.4)
Probably at AbstractArrowEntity L392 where it multiplies its motion by a negative number?
-
[1.16.1] How to register Stairs
I think what you mean is not Minecraft refuses to run, instead, the code compilation has failed. The second constructor of StairsBlock has a Supplier<BlockState> as its first parameter, but you are passing an instance of Block in it. You can check vanilla for examples.
-
Error when trying to get a file from resources
I don't think so, ResourceLocation will split the string into two piece, modid and the location. And if the modid does not exist (where there's ':' or not, and if it's empty in front of ':') it will assign minecraft modid to it.
-
[1.16.4] [SOLVED] Problems ticking client side method on TileEntity
If I understand it correctly getUpdateTag provides the information that needs to be synced (check its doc), and getUpdatePacket provides the packet that going to be send to the client, I think it's fine to put any number for the tileEntityTypeIn (the second parameter of SUpdateTileEntityPacket), since it's hardcoded to check if the tileentity and the number matches. And then onDataPacket is called when the client has received the packet, it provides the data send from the server which you gather the information you need for client from it.
-
[1.16.4] [SOLVED] Problems ticking client side method on TileEntity
Block.onBlockActivate: if world.isRemote: do nothing else: revert DynamiteTileEntity.active DynamiteTileEntity.tick: if world.isRemote & active: spawn particles DynamiteTileEntity.active on client side is always false as it's never updated. Although it can be caused by something else but I can't access your full code so this is just my guess. You need to find a way to sync the value, using some default syncing methods in TileEntity/IForgeTileEntity e.g. getUpdatePacket and onDataPacket. There are also quite a lot of posts about this, you should have a look at them.
-
Exception in thread "main"
Please post the whole log.
-
Make Un Burnable Items in 1.15
Do you mean Item Entities? If so you can set isImmuneToFire() in your item/block item item properties.
-
Player for ClientChatEvent [ solved ]
You’ve found out already didn't you?
-
[1.16.4]Get biome doesn't working
Sorry I did not read your question properly, I don't know why getBiome returns null, sorry.
-
[1.16.4]Get biome doesn't working
The world can be null.
-
[1.16.4] Custom Crafting Table in Mod
If you check WorkbenchContainer#canInteractWith you will see it hardcoded that the block must be Blocks.CRAFTING_TABLE in order for the player to interact with the container.
-
[SOLVED] [1.16.4] Entity Attributes not Registering
It seems like you've never assign a value to test_entity.
-
Attenuation Distance not applicable for sounds played by server
I've simplified my problem into a smaller area: https://bitbucket.org/poopoodice/ava/src/1.16.x/src/main/java/poopoodice/ava/items/miscs/TestItem.java @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity player, Hand handIn) { if (worldIn.isRemote()) player.world.playSound(player, 0, 1, 0, AVASounds.GENERIC_GRENADE_EXPLODE, SoundCategory.PLAYERS, 1.0F, 1.0F); if (!worldIn.isRemote()) player.world.playSound(null, 0, 0, 0, AVASounds.GENERIC_GRENADE_EXPLODE, SoundCategory.PLAYERS, 1.0F, 1.0F); worldIn.playSound(player, 0, 0, 0, AVASounds.GENERIC_GRENADE_EXPLODE, SoundCategory.PLAYERS, 1.0F, 1.0F); return super.onItemRightClick(worldIn, player, handIn); } My test result: 1. The first World#playSound -> result in the attenuation distance is applied (can be heard from 16+ blocks away) 2. The second World#playSound -> result in the attenuation distance is not applied (cannot be heard from 16+ blocks away) 3. The third World#playSound -> result in the attenuation distance is applied It seems like playing sound on server world will only send to the players that are within the radius of max(16.0F, volume * 16.0F), and for other vanilla sounds that uses greater attenuation distance for example ravager's roar, it is played on both sides which will work. If I can only play the sound on server while the attenuation effect to be applied, the only way I can think of is send packets to all players, is that necessary or is there an alternative way of doing it? Edit: Sending Customs packets works.
-
Attenuation Distance not applicable for sounds played by server
Hello, after spending lots of time investigating why attenuation distance does not work, I figured out that it only works when the sound is played on client. Is this intentional?
-
Minecraft Mod texture not loading in
Don't use capital letters, and you misspelled textures to texutres, the console should tell you what files are expected but not found.
-
multi block with gaps
Check how the torches and blocks like that manages to break according to the neighborhood changes (updatePostPlacement).
-
[1.16.1] Block RenderType
Also you should be doing in on client only - client setup not common setup.
-
[1.16] How to run code on world tick?
They are located inside TickEvent. https://docs.oracle.com/javase/tutorial/java/javaOO/nested.html
-
[1.16] How to run code on world tick?
TickEvent has multiple sub events, in this case you should use WorldTickEvent which provides the world instance.
-
[1.16.4] Damage ItemStack through Json Shaped/Shapeless craft?
Use the one in IForgeItem
-
How do I add custom trades to the Wandering Trader?
RegistryObject is an extension of java.util.function.Supplier
-
Simple First Person Animation
You can change item model through ItemPropertyOverrides https://mcforge.readthedocs.io/en/latest/models/overrides/, like bows...etc.
-
Crossbow-like loading running in loop
You also need to override isCrossbow in your item class.
-
Shortened link in minecraft chat
The text being displayed and its action are separated therefore you can just create a new style with click event (Style#setClickEvent), and then use TextComponent#setStyle to assign the style to the text.
IPS spam blocked by CleanTalk.