User Tools

Site Tools


tutorial:entity-old

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
tutorial:entity [2020/05/10 18:13] – Add tutorial on entity loot tables conorthedevtutorial:entity [2020/05/24 21:37] – size -> dimensions yanis48
Line 31: Line 31:
         Registry.ENTITY_TYPE,         Registry.ENTITY_TYPE,
         new Identifier("wiki_entity", "cookie_creeper"),         new Identifier("wiki_entity", "cookie_creeper"),
-        FabricEntityTypeBuilder.create(EntityCategory.AMBIENT, CookieCreeperEntity::new).size(EntityDimensions.fixed(1, 2)).build()+        FabricEntityTypeBuilder.create(EntityCategory.AMBIENT, CookieCreeperEntity::new).dimensions(EntityDimensions.fixed(1, 2)).build()
     );     );
 </code> </code>
Line 39: Line 39:
 </code> </code>
  
-The size() method allows you to set the hitbox of your entity. A creeper is 1 block wide and 2 blocks tall, so we'll use (1, 2). +The dimensions() method allows you to set the hitbox of your entity. A creeper is 1 block wide and 2 blocks tall, so we'll use (1, 2). 
  
 If you load up your game at this point, you will be able to use /summon to see your creation. If all went right, it should appear as a normal creeper. I would not recommend going into survival.  If you load up your game at this point, you will be able to use /summon to see your creation. If all went right, it should appear as a normal creeper. I would not recommend going into survival. 
Line 132: Line 132:
  
 ==== Entity Drops (loot tables) ==== ==== Entity Drops (loot tables) ====
-When you kill the cookie creeper, at the moment it doesn't drop anything! For this example, I'll be making the cookie creeper drop 1 cookie every time you kill it.+When you kill the cookie creeper, at the moment it doesn't drop anything! For this example, We'll be making the cookie creeper drop 1 cookie every time you kill it.
  
 For this, we need to use loot tables. To get started, we're going to create the file that tells Minecraft what our entity loot table is (''resources/data/wiki_entity/loot_tables/entities/cookie_creeper.json''): For this, we need to use loot tables. To get started, we're going to create the file that tells Minecraft what our entity loot table is (''resources/data/wiki_entity/loot_tables/entities/cookie_creeper.json''):
tutorial/entity-old.txt · Last modified: 2020/06/11 20:06 by draylar