Alexiy
Forge Modder-
Posts
198 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Alexiy
-
[1.12.2]How does one use Item.getBurnTime on a Block
Alexiy replied to karrablaster123's topic in Modder Support
It isn't that bad compared to what was a couple of years ago. Now there is plenty of open source code to look at if you can't find documentation. People contribute to Forge for free, so don't expect it to be professional-grade project. -
[1.12.2]How does one use Item.getBurnTime on a Block
Alexiy replied to karrablaster123's topic in Modder Support
Use FurnaceFuelBurnTimeEvent. -
I don't know what I've done with my project, by I am unable to create any world anymore. It stucks on world loading screen. Here is the log: https://pastebin.com/V2bKUvcq
-
Override 'getItemEnchantability' and return respective tool material enchantability.
-
It is intented to send changes to client, so it's effective on server only.
-
I believe you still have to create a block for your fluid, because for texture to render you have to use ModelLoader.registerItemVariants and ModelLoader.setCustomMeshDefinition. They both accept Item, in your case, it will be an ItemBlock with your fluid block instance.
-
Have you tried setting xSize, ySize, guiLeft and guiTop? For example: @Override public void initGui() { super.initGui(); xSize=width-10; ySize=height-10; guiLeft=(width-xSize)/2; guiTop=(height-ySize)/2; } "width" and "height" fields are the ones that scale when screen size changes.
-
I know that if you click outside gui borders, a slot index of -999 will be passed to Container#slotClick method, so you might want to make use of that.
-
Well, I implemented that in my custom handler. But I suppose it wouldn't be accepted in a pull request to Forge? I don't like that when, say, there is a stack in slot 12 with size 24, and a hopper inserts a stack with same item into empty slot 3 just because this slot happened to be found first.
-
I suppose you can do this in Item#getSubItems function.
-
Is there a reason that Forge's item handler doesn't merge incoming stacks with existing stacks first, but inserts into empty slot first instead? Is it performance?
-
Are your json files' names lowercase?
-
Need A ItemPickup Event For Achievements [1.11.2]
Alexiy replied to Emerald_Galaxy's topic in Modder Support
ItemPickupEvent is currently broken. -
ItemChease.json must be lowercase
-
[1.11] @SubscribeEvents inside Block class not running
Alexiy replied to MSpace-Dev's topic in Modder Support
You can't. What you can do is utilize the position from the event, create an AA-bounding box of desired range and check for presence of your block within that box. -
I have a little mod which adds one creature (dragon). It has four variations. The variation is registered in data manager. When the creature is spawned, it's variation is set based on the biome where it spawns. Parameters of the dragon: public static final DataParameter<Integer> dragonType = EntityDataManager.createKey(EntityDragon.class, DataSerializers.VARINT); private static final DataParameter<Optional<UUID>> ownerID = EntityDataManager.createKey(EntityDragon.class,DataSerializers.OPTIONAL_UNIQUE_ID); private Entity owner; public static final DataParameter<Boolean> sitting = EntityDataManager.createKey(EntityDragon.class,DataSerializers.BOOLEAN); @Override protected void entityInit() { super.entityInit(); setSize(0.7f,0.85f); dataManager.register(dragonType,0); dataManager.register(ownerID, Optional.absent()); dataManager.register(sitting,false); } Setting the dragon type: @SubscribeEvent public void setDragonType(LivingSpawnEvent.SpecialSpawn livingSpawnEvent) { EntityLivingBase entityLivingBase=livingSpawnEvent.getEntityLiving(); if(entityLivingBase instanceof EntityDragon) { BlockPos blockPos=new BlockPos(livingSpawnEvent.getX(),livingSpawnEvent.getY(),livingSpawnEvent.getZ()); Biome biome=livingSpawnEvent.getWorld().getBiome(blockPos); int type=0; if(biome instanceof BiomeJungle) type=EntityDragon.GREEN; else if(biome instanceof BiomeDesert) type=EntityDragon.GOLD; else if(biome instanceof BiomeForest) type=EntityDragon.EBONY; else if(biome instanceof BiomeHills) type=EntityDragon.SILVER; entityLivingBase.getDataManager().set(EntityDragon.dragonType,type); } } The question is, is it possible to set the type without using the event? I couldn't find a suitable method to override that would have the dragon's position set.
-
'LivingDropsEvent'Problem ,How to set the drops twice as long?
Alexiy replied to themaw's topic in Modder Support
You can copy the itemstacks from the entity items in the list, then create new entity items for copied drops, then add those to the list. -
'LivingDropsEvent'Problem ,How to set the drops twice as long?
Alexiy replied to themaw's topic in Modder Support
e.drops.addAll(e.drops); I don't think this will have any effect. -
Take a look at one of preset item models - assets/minecraft/models/item/handheld.json and ~generated.json. There are various sections. You should use one that corresponds to hotbar display in your json file and change the rotation, scale and translation as you like.