Usage of events

From MCreator Wiki
Jump to: navigation, search


Contents

Notice

We are currently in the process of revamping this page. That means it's a work in progress. Proceed at your own risk.

Events

Events are things that happen when something is done in game. For example when block is placed. A lot of people think that events are buggy. They are NOT! They are only hard to use and understand and that is why you see this article.

Conditions

If you are searching for usage of event conditions, you should check Event conditions page.

Coordinates in events

Coordinates marked as x, y and z have different names in MCreator. They are i, j and k. This is IJK coordinate system (see image below).

You can do mathematical operations with these coordiantes. Check this page: Mathematical operations with event parameters

Token system in events

You can also add tokens in event output (ex. chat). You can read more about tokens at this page: Tokens in events

Custom code

You can also apply custom code in events. In this case you need to know this: Here are some typical naming guidelines for method parameters:

  • Integers i, j, k are coordinates
  • Intiger l is metadata (if present)
  • Object world is World instance
  • Object entity is Entity instance
  • Object entityPlayer is Player instance

In all events you have world and i, j, k. Other parameters wary on event type. You should check minecraft JavaDOC or its source code.

List of Events

And a little description as well!

  • Custom Code - Well this is an area where if you know java, you can create your own event.
  • Remove block - Removes the block
  • Add block - Will make a selected block (Chose the item in the silver button)
  • Explode - Well.. it explodes. You can set the power of the explosion.
  • Strike Lightning - Strikes Lightning on the place of the block. Could be combined with the spawn entity below to make a charged creeper
  • Spawn entity - Spawns an entity (Such as mobs)
  • Resize - Resizes the block. You can set the preferences
  • Print text - Shows some text in the chat
  • Deal damage - Deals damage
  • Set light value - Changes how much light it gives off
  • Set resistance - changes how resistant to explosives it is
  • Play sound - Plays a sound of your choice -
  • Open browser - Opens a website page
  • Play music - Plays one of Minecrafts songs
  • Play sound - Plays a sound. Look at List of sound effects to see what sound you want to play
  • Spawn particle - Spawns a particle of your choice
  • Redstone power - Lets you choose if redstone turns on/off
  • Set time - changes the time to a certain period
  • Set spawn - sets the spawn point
  • Variable set - Sets a variable
  • Spawn gem - Spawns a gem, chosen from the silver button
  • Open crafting GUI - Opens the crafting gui. (what you see when you right click a crafting table)
  • Achievement get - Awards an achievement
  • Switch dimension for entity - this sends you to a different dimension.
  • Damage Item - Lowers the durability

Event Triggers

These are things that trigger events to occur

  • When block added - ===
  • When neighbor block changes - ===
  • Update tick - ===
  • Random update event - ===
  • When block destroyed by player - When a player destroys the block, an event occurs
  • When block destroyed by explosion - When a block is destroyed by an explosion an event occurs
  • When start to destroy - When a player begins breaking a block an event will occur. (like redstone ore glows and gives off particles)
  • When powering - ===
  • When block placed - When the block is placed an event will occur
  • When mob/player collides - When a mob/player touches it an event will occur
  • When block is placed by this block - ===
  • On block right clicked - If a player right clicks it an event will occur
  • Redstone on - When powered by redstone an event will happen
  • Redstone off - When it isn't being powered by redstone an event will happen
  • When right clicked with item - When you right click with the item an event occurs
  • When clicked on block - ===
  • On item creation - When the item is created an event occurs
  • When item destroys block - When the item destroys a block an event will occur
  • When mob killed with item - When you kill a mob with the item a event will occur
  • When it is struck with lightning - When a mob is struck by lightning an event will occur
  • When mob falls - When a mob falls an event will occur
  • When killed - When the mob is killed an event will occur
  • When mob attacks - When the mob attacks an event will occur
You need JavaScript enabled for viewing comments
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox
Google AdSense