Jump to content

Custom Mob Drops


AssassinHero

Recommended Posts

there are tutorials for all of this beginning stuff all over the internets, stop coming on here first jeez, only come one here when you cant find the answer any where else.

 

http://www.minecraftforum.net/topic/1452051-15-wip-again-deverions-forge-modding-tutorials-updated-16-03-2013-15-tutorials-1/

http://www.minecraftforum.net/topic/1431137-147-forge-smp-modding-tutorials-updated-3-3-2013-english-chinese-german-swedish-and-polish/

http://www.minecraftforge.net/wiki/Basic_Modding

http://darkhaxspace.weebly.com

 

three great examples to prove my point and that was 2 secs of looking

Use examples, i have aspergers.

Examples make sense to me.

Link to comment
Share on other sites

there are tutorials for all of this beginning stuff all over the internets, stop coming on here first jeez, only come one here when you cant find the answer any where else.

 

http://www.minecraftforum.net/topic/1452051-15-wip-again-deverions-forge-modding-tutorials-updated-16-03-2013-15-tutorials-1/

http://www.minecraftforum.net/topic/1431137-147-forge-smp-modding-tutorials-updated-3-3-2013-english-chinese-german-swedish-and-polish/

http://www.minecraftforge.net/wiki/Basic_Modding

http://darkhaxspace.weebly.com

 

three great examples to prove my point and that was 2 secs of looking

 

This is a good source of information for modders. It really doesn't matter where you go. This wasn't created as a last resort jesus, Go get some manners and then come back

STOP CRUCIFYING NEW MODDERS!!!!

Link to comment
Share on other sites

yes i know it is a good source of information but this requires other people to constantly answer simply questions when you could just spend 5 minutes googling it instead and they can focus on the parts like when you get stuck and cant find an answer or some or the harder modifications. In short your just being lazy and it is taking up people time.

Use examples, i have aspergers.

Examples make sense to me.

Link to comment
Share on other sites

yes i know it is a good source of information but this requires other people to constantly answer simply questions when you could just spend 5 minutes googling it instead and they can focus on the parts like when you get stuck and cant find an answer or some or the harder modifications. In short your just being lazy and it is taking up people time.

 

Don't like it then leave. No-one HAS to answer these they do because they want to help

STOP CRUCIFYING NEW MODDERS!!!!

Link to comment
Share on other sites

i can understand why you would find this funny but i only ask a question on here after i have googled it alot :) only if i cannot find the answer to my problems elsewhere do i ask a question on here. Well i try anyway i search for the answer on my own before i ask the forums, it is silly to ask for you to repeat something that is written down somewhere else.

Use examples, i have aspergers.

Examples make sense to me.

Link to comment
Share on other sites

  • 6 months later...

I finally figured this out for myself! If anyone is still interested in how this works, here is an example of the code:

 

 

@ForgeSubscribe

public void onEntityDrop(LivingDropsEvent event) {

if (event.entityLiving instanceof EntityCreeper){

if (rand < 0.1D) {

event.entityLiving.dropItem(YourCustomItem, 1);

}

}

}

 

 

The part where you put in your custom item needs to be in the format of YourMod.YourItem.itemID.

 

This is for 1.5.2 by the way.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
    • It is an issue with quark - update it to this build: https://www.curseforge.com/minecraft/mc-mods/quark/files/3642325
    • Remove Instant Massive Structures Mod from your server     Add new crash-reports with sites like https://paste.ee/  
    • Update your drivers: https://www.amd.com/en/support/graphics/amd-radeon-r9-series/amd-radeon-r9-200-series/amd-radeon-r9-280x
  • Topics

×
×
  • Create New...

Important Information

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