Skip to content
Chocolf edited this page Jun 19, 2024 · 98 revisions

Contents

Download and Installation

Downloading MoneyFromMobs

To download MoneyFromMobs, visit the Spigot page and look for the "Download Now" button. Once downloaded, turn off your server and move the MoneyFromMobs.jar into your plugins folder. A folder called MoneyFromMobs will be created inside of your plugins folder which contains the config files for MoneyFromMobs

Dependencies

Before MoneyFromMobs works you will need 3 other plugins:

  • Vault
  • An Economy plugin. (EssentialsX comes with a built in economy plugin if you are struggling to find a suitable economy plugin.)
  • A permissions plugin. I recommend LuckPerms becaues of its easy to use web interface,

Contact Me

Found a bug, have a suggestion, or need help? PM me on Spigot or post it in the Discussion section of the plugin. You can also make a post on the Issue Tracker but I may take longer to reply since I don't check GitHub as much. Before reporting a bug, make sure you are using PaperMC and the latest version of MoneyFromMobs

Features

  • Make Mobs and Players drop money on death
  • The Looting Enchantment on the killers weapon increases the amount of money dropped using a percentage.
  • Make money drop as an item or make money go straight into the players account.
  • Change the Item type and its Custom Model Data - Also supports Custom heads
  • Change the Drop Chance, Number of Drops and Amount of money dropped on every mob.
  • Permission multipliers allow higher ranks to get more money than lower ranks.
  • Change the Sound, Particle and Message sent when a player picks up money.
  • Option to show message in chat, above action bar or as a Holographic message
  • RGB support for 1.16+
  • Option to stop mobs that were spawned naturally, by spawners or by splitting from a bigger slime from dropping money.
  • Disable money drops in specified Worlds and WorldGuard Regions
  • Players with a full inventory can pick up money when using Paper 1.13+
  • Set max number of drops per minute for each player to combat mob farms
  • Option to Automatically remove money on the ground if it has not been picked up within 1 minute
  • Option to only allow the killer to pick up the dropped money
  • Create events where players can earn more money for a certain amount of time

Supported Plugins

There are a few optional plugins you can download that will enhance your experience with MoneyFromMobs. These include:

  • MythicMobs
    • Make Mythic mobs drop money and increase amount dropped based on their level
  • WorldGuard
    • Disable money drops in certain regions by using the flag 'drop-money' or 'player-drop-money' e.g /region flag region_name drop-money deny
  • PlaceholderAPI
    • %moneyfrommobs_latest_picked_up% - Shows the latest amount of money a player picked up
    • %moneyfrommobs_current_event_multiplier% - Shows the current event multiplier from /MfmEvent start]
    • %moneyfrommobs_current_event_time_left_seconds% - Shows the time left in seconds for the current event multiplier
  • LorinthsRpgMobs and LevelledMobs
    • Adds a multiplier that increases money dropped based on the mob's level
  • InfernalMobs
    • Adds a multiplier that increases money dropped if the mob was an Infernal Mob

Commands and Permissions

Command Permission Description
/MfmHelp MoneyFromMobs.help Shows all commands for MoneyFromMobs
/MfmReload MoneyFromMobs.reload Reloads the config
/MfmClear MoneyFromMobs.clear Clears all money from the ground. Can also be used to remove glitched holographic messages
/MfmMute MoneyFromMobs.mute Allows player to individually mute incoming messages when they pick up money
/AdminDropMoney <Amount> [NumberOfDrops] [World] [PosX] [PosY] [PosZ] MoneyFromMobs.AdminDropMoney Drops specified amount of money on players cursor. NumberOfDrops and position are optional
/DropMoney <Amount> MoneyFromMobs.DropMoney Drops specified amount of money infront of the player and takes from their balance (will not let the player drop more than they own)
/MfmEvent <Start/Stop> [Percentage Increase] [Duration e.g. 1h10m0s] MoneyFromMobs.event Create global multipliers for a specified amount of time. For example: /MfmEvent start 20% 1h10m0s will make all mobs drop 20% more money for 1 hour 10 minutes
MoneyFromMobs.use
(Given by default)
Allows players to kill mobs to obtain money and pick money up
MoneyFromMobs.PreventMoneyDropOnDeath Players with this permission will not drop money on death

Hooking into MoneyFromMobs

You can either download the jar from Spigot and then reference it manually in the java build path. or add the following to your pom.xml

        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>

        <dependency>
            <groupId>com.github.chocolf</groupId>
            <artifactId>MoneyFromMobs</artifactId>
            <version>4.9</version>
        </dependency>

Then you will need to add MoneyFromMobs to your depend/softdepend section in your plugin.yml file.

Events

Event Description Functions
AttemptToDropMoneyEvent Called when a mob dies that is enabled in the config getDropChance(), setDropChance(), getEntity(), getKiller()
DropMoneyEvent Called when a mob dies and drops money or someone uses /MfmDrop getAmount(), setAmount(), getLocation(), setLocation(), getKiller(), getEntity(), getNumberOfDrops(), setNumberOfDrops(), getItemToDrop(), setItemToDrop()
GiveMoneyEvent Called when a player picks up money from the ground or when they kill a mob and money is put straight into their balance getPlayer(), getAmount(), setAmount(), getSound(), setSound(), getParticle(), setParticle()

Examples

The first example shows that if the killer is holding an item named "Thief's Sword" when killing a mob, the drop chance for money to drop will always be 100%.

@EventHandler
public void onAttemptToDropMoney(AttemptToDropMoneyEvent e) {
	Player p = e.getKiller();
	if (p == null) return;
	String killersWeaponName = p.getInventory().getItemInMainHand().getItemMeta().getDisplayName();
	
	if (killersWeaponName.equals("Thief's Sword")) {
		e.setDropChance(100);
	}
}

The second example shows that if the killer is holding an item named "King Midas's Sword" when killing a mob, the item to be dropped will be changed into a gold ingot instead of whatever was set in the config and the amount to be dropped is doubled.
@EventHandler
public void onDropMoneyEvent(DropMoneyEvent e) {
	Player p = e.getKiller();
	if (p == null) return;
	String killersWeaponName = p.getInventory().getItemInMainHand().getItemMeta().getDisplayName();

	if (killersWeaponName.equals("King Midas's Sword")) {
		e.setItemToDrop(new ItemStack(Material.GOLD_INGOT));
		e.setAmount(e.getAmount()*2);
	}
}

The third example shows that if the killer is wearing a helmet named "King Midas's Crown" when they pick up money they will be healed for 2 hearts and will gain speed 2 for 3 seconds.
@EventHandler 
public void onGiveMoney(GiveMoneyEvent e) {
	Player p = e.getPlayer();
	if (p == null) return;
	ItemStack killersHelmet = p.getInventory().getHelmet();
	if ( killersHelmet != null) {
		String killersHelmetName = killersHelmet.getItemMeta().getDisplayName();
		if (killersHelmetName.equals("King Midas's Crown")) {
			if (p.getHealth() + 4 <= 20) {
				p.setHealth(p.getHealth() + 4);
			}
			else {
				p.setHealth(20);
			}
			
			p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 60, 1));
		}
	}
}