Lil Putin Baby
U look funny
Status
offline
Posts
286
Likes
2,684
Resources
21
Credits
0
LEVEL
5
1,110 XP
Member suspended from NullForums
Status
Posts
286
Likes
2,684
Resources
21
Credits
0
1,110 XP
Status
Posts
286
Likes
2,684
Resources
21
Credits
0
1,110 XP
Status
Posts
38
Likes
2,208
Resources
15
Credits
0
1,115 XP
idk xd(This thread is not a giveaway, I just want to start a useful thread)
Admin
Status
Posts
14,927
Likes
129,929
Resources
3,394
Credits
486
5,910 XP
public void onItemDrop (PlayerDropItemEvent event){ // Fired when a player drops an item
Item dropedItem = event.getItemDrop(); // Get the item (as an entity) that the player droped
}
Status
Posts
286
Likes
2,684
Resources
21
Credits
0
1,110 XP
how can I give an admin MC PASS? I will find a better answer.Just to clarify:
You'd like a dye item to switch dye types once picked up, correct?
Is just the player going to receive this event on pickup, or other entities as well?
You might want to take a look at the DopItemEvents, along with ItemStackEvent. These contain loads of interesting calls .
https://hub.spigotmc.org/javadocs/s...player/PlayerDropItemEvent.html#getItemDrop()
https://hub.spigotmc.org/javadocs/s...#setItemStack(org.bukkit.inventory.ItemStack)
Status
Posts
38
Likes
2,208
Resources
15
Credits
0
1,115 XP
Give it to mehow can I give an admin MC PASS? I will find a better answer.
Status
Posts
286
Likes
2,684
Resources
21
Credits
0
1,110 XP
FateKid has a better answer than you ᗪ乇ᐯ丨ㄥㅤᗪ丨ᗪㅤ丨ㄒGive it to me
Status
Posts
38
Likes
2,208
Resources
15
Credits
0
1,115 XP
xdFateKid has a better answer than you ᗪ乇ᐯ丨ㄥㅤᗪ丨ᗪㅤ丨ㄒ
Admin
Status
Posts
14,927
Likes
129,929
Resources
3,394
Credits
486
5,910 XP
We can distribute them if needed.how can I give an admin MC PASS? I will find a better answer.
Status
Posts
688
Likes
5,828
Credits
195
2,465 XP
@Getter
private List<Material> dyeColors;
@Override
public void onEnable() {
dyeColors = new ArrayList<>();
for(DyeColor dyeColor : DyeColor.values()) {
dyeColors.add(Material.getMaterial(dyeColor.toString() + "_DYE"));
}
Bukkit.getPluginManager().registerEvents(new PlayerPickupItemListener(this), this);
}
@EventHandler
public void onPlayerPickupItem(EntityPickupItemEvent event) {
if(event.getEntity() instanceof Player) {
Player player = (Player) event.getEntity();
if(plugin.getDyeColors().contains(event.getItem().getItemStack().getType())) {
event.getItem().getItemStack().setType(plugin.getDyeColors().get(
new Random().nextInt(plugin.getDyeColors().size())));
}
}
}
Admin
Status
Posts
14,927
Likes
129,929
Resources
3,394
Credits
486
5,910 XP
Wow I was WAY OFF.Here you go
Status
Posts
286
Likes
2,684
Resources
21
Credits
0
1,110 XP
Admin
Status
Posts
14,927
Likes
129,929
Resources
3,394
Credits
486
5,910 XP
Same here! With the little java I know currently, I'm more than happy to help where I can.If you need anything to code i will be glad to.
Admin
Status
Posts
14,927
Likes
129,929
Resources
3,394
Credits
486
5,910 XP
Status
Posts
286
Likes
2,684
Resources
21
Credits
0
1,110 XP
Thanks for creating it!Kirazie created the plugin you're looking for
RanDye - Randomized Dye on Pickup
Just a plugin that was brought up on the forums here 😁 Original Post - Coding support by Яков Егоров Decided I'll share it since someone might want it for actual use or just to learn.nullforums.net
Status
Posts
688
Likes
5,828
Credits
195
2,465 XP
No problem at all! Wrote the code out for the post and basically just had to compile for actual useThanks for creating it!