-
Posts
1160 -
Joined
-
Days Won
7
Everything posted by poopoodice
-
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)
poopoodice replied to Babelincoln1809's topic in Modder Support
Probably at AbstractArrowEntity L392 where it multiplies its motion by a negative number? -
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
poopoodice replied to Abdymazhit's topic in Modder Support
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. -
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.
-
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.
-
Please post the whole log.
-
Do you mean Item Entities? If so you can set isImmuneToFire() in your item/block item item properties.
-
You’ve found out already didn't you?
-
Sorry I did not read your question properly, I don't know why getBiome returns null, sorry.
-
The world can be null.
-
[1.16.4] Custom Crafting Table in Mod
poopoodice replied to shadowdragon625's topic in Modder Support
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
poopoodice replied to UserMC123's topic in Modder Support
It seems like you've never assign a value to test_entity. -
Attenuation Distance not applicable for sounds played by server
poopoodice replied to poopoodice's topic in Modder Support
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. -
Don't use capital letters, and you misspelled textures to texutres, the console should tell you what files are expected but not found.
-
Check how the torches and blocks like that manages to break according to the neighborhood changes (updatePostPlacement).
-
Also you should be doing in on client only - client setup not common setup.
-
They are located inside TickEvent. https://docs.oracle.com/javase/tutorial/java/javaOO/nested.html
-
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?
poopoodice replied to Shiroroku's topic in Modder Support
Use the one in IForgeItem -
How do I add custom trades to the Wandering Trader?
poopoodice replied to Moomallowz's topic in Modder Support
RegistryObject is an extension of java.util.function.Supplier -
You can change item model through ItemPropertyOverrides https://mcforge.readthedocs.io/en/latest/models/overrides/, like bows...etc.
-
You also need to override isCrossbow in your item class.
-
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.